]>
Commit | Line | Data |
---|---|---|
5d5732b0 | 1 | # Copyright (C) 1995-2007,2008,2009,2010,2011 Free Software Foundation, Inc. |
01cc0be6 RM |
2 | # This file is part of the GNU C Library. |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
5 | # modify it under the terms of the GNU Lesser General Public |
6 | # License as published by the Free Software Foundation; either | |
7 | # version 2.1 of the License, or (at your option) any later version. | |
01cc0be6 RM |
8 | |
9 | # The GNU C Library is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
01cc0be6 | 13 | |
41bdb6e2 AJ |
14 | # You should have received a copy of the GNU Lesser General Public |
15 | # License along with the GNU C Library; if not, write to the Free | |
16 | # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | |
17 | # 02111-1307 USA. | |
01cc0be6 | 18 | |
3db52d94 UD |
19 | # Makefile for elf subdirectory of GNU C Library. |
20 | ||
d66e34cd RM |
21 | subdir := elf |
22 | ||
9fbdeb41 | 23 | headers = elf.h bits/elfclass.h link.h bits/link.h |
9dcafc55 | 24 | routines = $(dl-routines) dl-support dl-iteratephdr \ |
27d640be | 25 | dl-addr enbl-secure dl-profstub \ |
368a8dec | 26 | dl-origin dl-libc dl-sym dl-tsd dl-sysdep |
266180eb RM |
27 | |
28 | # The core dynamic linking functions are in libc for the static and | |
29 | # profiled libraries. | |
f18edac3 | 30 | dl-routines = $(addprefix dl-,load cache lookup object reloc deps \ |
a3d731d3 | 31 | runtime error init fini debug misc \ |
87cfd82a | 32 | version profile conflict tls origin scope \ |
9dcafc55 | 33 | execstack caller open close trampoline) |
b79f74cd | 34 | all-dl-routines = $(dl-routines) $(sysdep-dl-routines) |
266180eb | 35 | # But they are absent from the shared libc, because that code is in ld.so. |
368a8dec UD |
36 | elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \ |
37 | dl-sysdep | |
44094580 | 38 | shared-only-routines += dl-caller |
266180eb RM |
39 | |
40 | # ld.so uses those routines, plus some special stuff for being the program | |
41 | # interpreter and operating independent of libc. | |
ce460d04 | 42 | rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal |
e39e6956 | 43 | all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines) |
b79f74cd | 44 | |
ce460d04 RM |
45 | distribute := rtld-Rules \ |
46 | $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \ | |
b3ed8219 | 47 | dl-cache.h dl-hash.h soinit.c sofini.c ldd.bash.in \ |
94e365c6 UD |
48 | genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \ |
49 | dl-librecon.h interp.c sln.c dl-dst.h hp-timing.h \ | |
786b74f4 | 50 | dl-lookupcfg.h sprof.c gen-trusted-dirs.awk \ |
94e365c6 | 51 | testobj1.c testobj2.c testobj3.c testobj4.c testobj5.c \ |
2b7238dd | 52 | testobj6.c testobj1_1.c failobj.c unloadmod.c \ |
84ddc586 | 53 | ldconfig.h ldconfig.c cache.c readlib.c readelflib.c \ |
e340a2a2 | 54 | chroot_canon.c gccframe.h \ |
74955460 | 55 | dep1.c dep2.c dep3.c dep4.c dl-dtprocnum.h unsecvars.h \ |
afa0569f | 56 | vismain.c vismod1.c vismod2.c vismod3.c \ |
74dd1fee UD |
57 | constload2.c constload3.c filtmod1.c filtmod2.c \ |
58 | nodlopenmod.c nodelete.c nodelmod1.c nodelmod2.c \ | |
2b7238dd | 59 | nodelmod3.c nodelmod4.c nodlopen.c dl-osinfo.h \ |
917fd061 | 60 | reldepmod1.c reldepmod2.c reldepmod3.c reldepmod4.c \ |
c4bb124a | 61 | reldepmod5.c reldepmod6.c \ |
1826d793 | 62 | reldep4mod1.c reldep4mod2.c reldep4mod3.c reldep4mod4.c \ |
8bc6161d | 63 | nextmod1.c nextmod2.c pathoptobj.c tst-pathopt.sh \ |
5ab7f7c1 | 64 | neededobj1.c neededobj2.c neededobj3.c neededobj4.c \ |
421f0c9d | 65 | neededobj5.c neededobj6.c firstobj.c \ |
1a511d31 | 66 | unload2mod.c unload2dep.c ltglobmod1.c ltglobmod2.c \ |
3fac0001 | 67 | testobj.h vismod.h globalmod1.c \ |
ab92bebd UD |
68 | dblloadmod1.c dblloadmod2.c dblloadmod3.c \ |
69 | reldep6mod4.c reldep6mod3.c reldep6mod2.c reldep6mod1.c \ | |
a41d8a74 | 70 | reldep6mod0.c reldep7mod1.c reldep7mod2.c \ |
ab92bebd | 71 | unwind-dw2.c unwind-dw2-fde.c unwind.h unwind-pe.h \ |
2cef4257 | 72 | unwind-dw2-fde.h dwarf2.h dl-procinfo.c tls.h dl-tls.h \ |
4c53d221 | 73 | tst-tlsmod1.c tst-tlsmod2.c tst-tlsmod3.c tst-tlsmod4.c \ |
94c24227 UD |
74 | tst-tlsmod5.c tst-tlsmod6.c tst-tlsmod7.c tst-tlsmod8.c \ |
75 | tst-tlsmod9.c tst-tlsmod10.c tst-tlsmod11.c \ | |
be184b1d | 76 | tst-tlsmod12.c tst-tls10.h tst-alignmod.c tst-alignmod2.c \ |
4c53d221 UD |
77 | circlemod1.c circlemod1a.c circlemod2.c circlemod2a.c \ |
78 | circlemod3.c circlemod3a.c nodlopenmod2.c \ | |
d26dfc60 | 79 | tst-tls19mod1.c tst-tls19mod2.c tst-tls19mod3.c \ |
cfaf5e56 | 80 | tls-macros.h \ |
aff4519d UD |
81 | reldep8mod1.c reldep8mod2.c reldep8mod3.c \ |
82 | nodel2mod1.c nodel2mod2.c nodel2mod3.c \ | |
ec503662 UD |
83 | reldep9.c reldep9mod1.c reldep9mod2.c reldep9mod3.c \ |
84 | tst-array1.exp tst-array2.exp tst-array4.exp \ | |
f17ed1a9 | 85 | tst-array2dep.c tst-piemod1.c \ |
bed12f78 | 86 | tst-execstack-mod.c tst-dlmodcount.c \ |
1fc07491 | 87 | check-textrel.c dl-sysdep.h test-dlopenrpathmod.c \ |
9dcafc55 | 88 | tst-deep1mod1.c tst-deep1mod2.c tst-deep1mod3.c \ |
fab0abb4 | 89 | unload3mod1.c unload3mod2.c unload3mod3.c unload3mod4.c \ |
20fe49b9 | 90 | unload4mod1.c unload4mod2.c unload4mod3.c unload4mod4.c \ |
dc936e2b | 91 | unload6mod1.c unload6mod2.c unload6mod3.c \ |
1ee2ff20 | 92 | unload7mod1.c unload7mod2.c \ |
b0ecde3a | 93 | tst-audit1.c tst-audit2.c tst-audit3.c tst-audit4.c \ |
167d5ed5 | 94 | tst-auditmod1.c tst-auditmod3a.c tst-auditmod3b.c \ |
b0ecde3a L |
95 | tst-auditmod4a.c tst-auditmod4b.c \ |
96 | tst-audit5.c tst-auditmod5a.c tst-auditmod5b.c \ | |
4e1e2f42 L |
97 | tst-audit6.c tst-auditmod6a.c tst-auditmod6b.c \ |
98 | tst-auditmod6c.c \ | |
99 | tst-audit7.c tst-auditmod7a.c tst-auditmod7b.c \ | |
35f1e827 | 100 | order2mod1.c order2mod2.c order2mod3.c order2mod4.c \ |
04395c90 UD |
101 | tst-stackguard1.c tst-stackguard1-static.c \ |
102 | tst-array5.c tst-array5-static.c tst-array5dep.c \ | |
2f083d75 L |
103 | tst-array5.exp tst-leaks1.c check-execstack.c \ |
104 | ifuncmain1.c ifuncmain1pic.c ifuncmain1vis.c \ | |
105 | ifuncmain1vispic.c ifuncmain1static.c \ | |
106 | ifuncmain1staticpic.c ifuncmain1picstatic.c \ | |
107 | ifuncdep1.c ifuncdep1pic.c ifuncmod1.c \ | |
108 | ifuncmain1pie.c ifuncmain1vispie.c \ | |
3c30afc8 | 109 | ifuncmain1staticpie.c \ |
2f083d75 L |
110 | ifuncmain2.c ifuncmain2static.c ifuncdep2.c \ |
111 | ifuncmain2pic.c ifuncmain2picstatic.c ifuncdep2pic.c \ | |
112 | ifuncmain3.c ifuncmod3.c \ | |
3c30afc8 L |
113 | ifuncmain4.c ifuncmain4static.c ifuncmain4picstatic.c \ |
114 | ifuncmain5.c ifuncmain5pic.c ifuncmain5picstatic.c \ | |
115 | ifuncmain5pie.c ifuncmain5static.c \ | |
116 | ifuncmain5staticpic.c \ | |
117 | ifuncdep5.c ifuncdep5pic.c ifuncmod5.c \ | |
118 | ifuncmain6pie.c ifuncmod6.c \ | |
119 | ifuncmain7.c ifuncmain7pic.c ifuncmain7picstatic.c \ | |
415ac3df UD |
120 | ifuncmain7pie.c ifuncmain7static.c \ |
121 | tst-unique1.c tst-unique1mod1.c tst-unique1mod2.c \ | |
968dad0a | 122 | tst-unique2.c tst-unique2mod1.c tst-unique2mod2.c \ |
e888bcbe AS |
123 | tst-initordera1.c tst-initordera2.c tst-initorderb1.c \ |
124 | tst-initorderb2.c tst-initordera3.c tst-initordera4.c \ | |
125 | tst-initorder.c \ | |
126 | tst-initorder2.c | |
d66e34cd | 127 | |
80b54217 | 128 | CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables |
bb958f59 | 129 | CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables |
e07bb02a | 130 | CFLAGS-dl-iterate-phdr.c = $(uses-callbacks) |
80b54217 | 131 | |
05f732b3 UD |
132 | include ../Makeconfig |
133 | ||
74bd2300 | 134 | ifeq ($(unwind-find-fde),yes) |
a0dcb689 | 135 | routines += unwind-dw2-fde-glibc |
44094580 | 136 | shared-only-routines += unwind-dw2-fde-glibc |
74bd2300 UD |
137 | endif |
138 | ||
40c4c9b5 | 139 | before-compile = $(objpfx)trusted-dirs.h |
5a384a91 UD |
140 | generated := trusted-dirs.h trusted-dirs.st for-renamed/renamed.so |
141 | generated-dirs := for-renamed | |
fd26970f | 142 | |
bdd421cc | 143 | ifeq ($(versioning),yes) |
a0edd63e | 144 | ld-map = $(common-objpfx)ld.map |
bdd421cc UD |
145 | endif |
146 | ||
d66e34cd | 147 | ifeq (yes,$(build-shared)) |
b79f74cd | 148 | extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os |
40c4c9b5 | 149 | generated += librtld.os dl-allobjs.os ld.so ldd |
8d57beea | 150 | install-others = $(inst_slibdir)/$(rtld-installed-name) |
6c3ebebd | 151 | install-bin-script = ldd |
f49bc43f | 152 | endif |
86d2c878 | 153 | |
11988f8f UD |
154 | others = sprof sln pldd |
155 | install-bin = sprof pldd | |
9d141cae UD |
156 | others-static = sln |
157 | install-rootsbin = sln | |
ae828bc6 | 158 | |
591e1ffb | 159 | ifeq (yes,$(use-ldconfig)) |
99ac5e47 | 160 | ifeq (yes,$(build-shared)) |
e1586792 | 161 | others-static += ldconfig |
da2d1bc5 | 162 | others += ldconfig |
9d141cae | 163 | install-rootsbin += ldconfig |
591e1ffb | 164 | |
b4a555d6 | 165 | ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon |
591e1ffb UD |
166 | extra-objs += $(ldconfig-modules:=.o) |
167 | ||
11988f8f UD |
168 | pldd-modules := xmalloc |
169 | ||
591e1ffb UD |
170 | # To find xmalloc.c and xstrdup.c |
171 | vpath %.c ../locale/programs | |
172 | ||
99ac5e47 | 173 | endif |
1ef32c3d UD |
174 | endif |
175 | ||
a9171047 UD |
176 | ifeq ($(have-ksh)$(build-shared),yesyes) |
177 | extra-objs += sotruss-lib.os sotruss-lib.so | |
178 | install-others += $(inst_auditdir)/sotruss-lib.so | |
b0316e56 | 179 | install-bin-script += sotruss |
a9171047 UD |
180 | generated += sotruss |
181 | CPPFLAGS-sotruss-lib = -DNOT_IN_libc | |
a6928d51 | 182 | $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os |
a9171047 UD |
183 | $(build-module-asneeded) |
184 | $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \ | |
185 | $(common-objpfx)libc_nonshared.a | |
186 | ||
187 | $(objpfx)sotruss: sotruss.ksh $(common-objpfx)config.make | |
188 | sed -e 's%@KSH@%$(KSH)%g' \ | |
189 | -e 's%@VERSION@%$(version)%g' \ | |
190 | -e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g' \ | |
191 | -e 's%@PREFIX@%$(prefix)%g' < $< > $@.new | |
192 | chmod 555 $@.new | |
193 | mv -f $@.new $@ | |
194 | $(inst_auditdir)/sotruss-lib.so: $(objpfx)sotruss-lib.so $(+force) | |
195 | $(do-install-program) | |
196 | endif | |
197 | ||
2e0fc40c | 198 | tests = tst-tls1 tst-tls2 tst-tls9 tst-leaks1 |
dfe4c900 | 199 | ifeq (yes,$(have-initfini-array)) |
04395c90 | 200 | tests += tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 |
dfe4c900 | 201 | endif |
db265313 | 202 | ifeq (yes,$(build-static)) |
35f1e827 | 203 | tests-static = tst-tls1-static tst-tls2-static tst-stackguard1-static |
ec1af1d8 UD |
204 | ifeq (yesyesyes,$(build-static)$(build-shared)$(elf)) |
205 | tests-static += tst-tls9-static | |
206 | tst-tls9-static-ENV = \ | |
207 | LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn | |
208 | endif | |
43c59a70 | 209 | ifeq (yes,$(have-initfini-array)) |
04395c90 | 210 | tests-static += tst-array1-static tst-array5-static |
6ef518c3 | 211 | endif |
db265313 RM |
212 | tests += $(tests-static) |
213 | endif | |
2f512715 | 214 | ifeq (yes,$(build-shared)) |
db265313 | 215 | tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ |
9fb11d4c | 216 | constload1 order vismain noload filter unload \ |
11bf311e UD |
217 | reldep reldep2 reldep3 reldep4 nodelete nodelete2 \ |
218 | nodlopen nodlopen2 neededtest neededtest2 \ | |
db265313 | 219 | neededtest3 neededtest4 unload2 lateglobal initfirst global \ |
cfaf5e56 | 220 | restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \ |
94c24227 | 221 | circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \ |
d78efd9f | 222 | tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \ |
d26dfc60 | 223 | tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \ |
d78efd9f RM |
224 | tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \ |
225 | tst-dlmodcount tst-dlopenrpath tst-deep1 \ | |
226 | tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \ | |
d85f8ff6 | 227 | unload3 unload4 unload5 unload6 unload7 tst-global1 order2 \ |
cafdfdb6 | 228 | tst-audit1 tst-audit2 \ |
415ac3df | 229 | tst-stackguard1 tst-addr1 tst-thrlock \ |
320a5dc0 | 230 | tst-unique1 tst-unique2 tst-unique3 tst-unique4 \ |
e888bcbe | 231 | tst-initorder tst-initorder2 |
aff4519d | 232 | # reldep9 |
5a384a91 | 233 | test-srcs = tst-pathopt |
33f85a3f UD |
234 | selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null) |
235 | ifneq ($(selinux-enabled),1) | |
c70ba488 | 236 | tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog |
33f85a3f | 237 | endif |
167d5ed5 | 238 | ifeq (x86_64,$(config-machine)) |
0464f746 UD |
239 | tests += tst-audit3 tst-audit4 tst-audit5 |
240 | ifeq (yes,$(config-cflags-avx)) | |
241 | tests += tst-audit6 tst-audit7 | |
242 | endif | |
167d5ed5 | 243 | endif |
2f512715 | 244 | endif |
4bff6e01 | 245 | tests: $(objpfx)tst-leaks1-mem $(objpfx)noload-mem |
60a23f5a | 246 | tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
41e25904 | 247 | tlsmod18a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
1f20b93a AS |
248 | tlsmod17a-modules = $(addprefix tst-tlsmod17a, $(tlsmod17a-suffixes)) |
249 | tlsmod18a-modules = $(addprefix tst-tlsmod18a, $(tlsmod17a-suffixes)) | |
250 | extra-test-objs += $(tlsmod17a-modules:=.os) $(tlsmod18a-modules:=.os) | |
251 | test-extras += tst-tlsmod17a tst-tlsmod18a | |
a25f2023 | 252 | modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ |
2b7238dd | 253 | testobj1_1 failobj constload2 constload3 unloadmod \ |
9fb11d4c | 254 | dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \ |
11bf311e UD |
255 | nodelmod1 nodelmod2 nodelmod3 nodelmod4 \ |
256 | nodel2mod1 nodel2mod2 nodel2mod3 \ | |
257 | nodlopenmod nodlopenmod2 filtmod1 filtmod2 \ | |
ceb579a3 | 258 | reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \ |
1826d793 | 259 | reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \ |
8edd9172 | 260 | neededobj1 neededobj2 neededobj3 neededobj4 \ |
273a3cfb | 261 | neededobj5 neededobj6 firstobj globalmod1 \ |
3fac0001 | 262 | unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \ |
c47e78b1 | 263 | dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \ |
a3d731d3 | 264 | reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \ |
a41d8a74 | 265 | reldep7mod1 reldep7mod2 \ |
6d78cd00 | 266 | tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \ |
94c24227 UD |
267 | tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \ |
268 | tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \ | |
99fe3b0e | 269 | tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \ |
4c533566 | 270 | tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \ |
1f20b93a | 271 | $(tlsmod17a-modules) tst-tlsmod17b $(tlsmod18a-modules) \ |
d26dfc60 | 272 | tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \ |
6d78cd00 | 273 | circlemod1 circlemod1a circlemod2 circlemod2a \ |
cfaf5e56 | 274 | circlemod3 circlemod3a \ |
aff4519d | 275 | reldep8mod1 reldep8mod2 reldep8mod3 \ |
06f6ca90 | 276 | reldep9mod1 reldep9mod2 reldep9mod3 \ |
be184b1d UD |
277 | tst-alignmod tst-alignmod2 \ |
278 | $(modules-execstack-$(have-z-execstack)) \ | |
c0f62c56 | 279 | tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \ |
fab0abb4 | 280 | tst-dlmopen1mod tst-auditmod1 \ |
20fe49b9 | 281 | unload3mod1 unload3mod2 unload3mod3 unload3mod4 \ |
3d786f19 | 282 | unload4mod1 unload4mod2 unload4mod3 unload4mod4 \ |
bfc832cc | 283 | unload6mod1 unload6mod2 unload6mod3 \ |
1ee2ff20 | 284 | unload7mod1 unload7mod2 \ |
415ac3df UD |
285 | order2mod1 order2mod2 order2mod3 order2mod4 \ |
286 | tst-unique1mod1 tst-unique1mod2 \ | |
968dad0a | 287 | tst-unique2mod1 tst-unique2mod2 \ |
028478fa | 288 | tst-unique3lib tst-unique3lib2 \ |
320a5dc0 | 289 | tst-unique4lib \ |
968dad0a UD |
290 | tst-initordera1 tst-initorderb1 \ |
291 | tst-initordera2 tst-initorderb2 \ | |
e888bcbe AS |
292 | tst-initordera3 tst-initordera4 \ |
293 | tst-initorder2a tst-initorder2b tst-initorder2c tst-initorder2d | |
dfe4c900 | 294 | ifeq (yes,$(have-initfini-array)) |
04395c90 | 295 | modules-names += tst-array2dep tst-array5dep |
dfe4c900 | 296 | endif |
f17ed1a9 UD |
297 | ifeq (yesyes,$(have-fpie)$(build-shared)) |
298 | modules-names += tst-piemod1 | |
da62f81b AS |
299 | tests += tst-pie1 |
300 | tests-pie += tst-pie1 | |
f17ed1a9 | 301 | endif |
59cbcac0 UD |
302 | ifeq (x86_64,$(config-machine)) |
303 | modules-names += tst-auditmod3a tst-auditmod3b \ | |
304 | tst-auditmod4a tst-auditmod4b \ | |
4e1e2f42 L |
305 | tst-auditmod5a tst-auditmod5b \ |
306 | tst-auditmod6a tst-auditmod6b tst-auditmod6c \ | |
307 | tst-auditmod7a tst-auditmod7b | |
59cbcac0 | 308 | endif |
2abf9ff1 | 309 | modules-execstack-yes = tst-execstack-mod |
376e973a | 310 | extra-test-objs += $(addsuffix .os,$(strip $(modules-names))) |
724d8c3f RM |
311 | # We need this variable to be sure the test modules get the right CPPFLAGS. |
312 | test-extras += $(modules-names) | |
dc18d4d8 | 313 | |
aed48a2a RM |
314 | # filtmod1.so has a special rule |
315 | modules-names-nobuild := filtmod1 | |
316 | ||
5d5732b0 | 317 | ifneq (no,$(multi-arch)) |
2f083d75 L |
318 | tests-static += ifuncmain1static ifuncmain1picstatic \ |
319 | ifuncmain2static ifuncmain2picstatic \ | |
3c30afc8 L |
320 | ifuncmain4static ifuncmain4picstatic \ |
321 | ifuncmain5static ifuncmain5picstatic \ | |
322 | ifuncmain7static ifuncmain7picstatic | |
2f083d75 L |
323 | |
324 | ifeq (yes,$(build-shared)) | |
325 | tests += ifuncmain1 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \ | |
326 | ifuncmain1staticpic \ | |
3c30afc8 L |
327 | ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \ |
328 | ifuncmain5 ifuncmain5pic ifuncmain5staticpic \ | |
329 | ifuncmain7 ifuncmain7pic | |
1f20b93a AS |
330 | ifunc-test-modules = ifuncdep1 ifuncdep1pic ifuncdep2 ifuncdep2pic \ |
331 | ifuncdep5 ifuncdep5pic | |
332 | extra-test-objs += $(ifunc-test-modules:=.o) | |
333 | test-extras += $(ifunc-test-modules) | |
2f083d75 | 334 | ifeq (yes,$(have-fpie)) |
1f20b93a AS |
335 | ifunc-pie-tests = ifuncmain1pie ifuncmain1vispie ifuncmain1staticpie \ |
336 | ifuncmain5pie ifuncmain6pie ifuncmain7pie | |
da62f81b AS |
337 | tests += $(ifunc-pie-tests) |
338 | tests-pie += $(ifunc-pie-tests) | |
2f083d75 | 339 | endif |
3c30afc8 | 340 | modules-names += ifuncmod1 ifuncmod3 ifuncmod5 ifuncmod6 |
2f083d75 L |
341 | endif |
342 | endif | |
343 | ||
aed48a2a | 344 | |
01cc0be6 | 345 | include ../Rules |
d66e34cd | 346 | |
fd54683c RM |
347 | check-abi: check-abi-ld |
348 | update-abi: update-abi-ld | |
349 | ||
1ef32c3d | 350 | ifeq (yes,$(build-shared)) |
a89d30d4 RM |
351 | # Make sure these things are built in the `make lib' pass so they can be used |
352 | # to run programs during the `make others' pass. | |
353 | lib-noranlib: $(objpfx)$(rtld-installed-name) \ | |
354 | $(addprefix $(objpfx),$(extra-objs)) | |
355 | endif | |
356 | ||
db2286f6 | 357 | # Command to link into a larger single relocatable object. |
b350afab | 358 | reloc-link = $(LINK.o) -nostdlib -nostartfiles -r |
db2286f6 | 359 | |
a6928d51 RM |
360 | $(objpfx)sotruss-lib.so: $(shlib-lds) |
361 | ||
b79f74cd | 362 | $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os) |
ce460d04 | 363 | $(reloc-link) -o $@ $^ |
db2286f6 | 364 | |
86d2c878 | 365 | # Link together the dynamic linker into a single relocatable object. |
ce460d04 RM |
366 | # First we do a link against libc_pic.a just to get a link map, |
367 | # and discard the object produced by that link. From the link map | |
368 | # we can glean all the libc modules that need to go into the dynamic | |
369 | # linker. Then we do a recursive make that goes into all the subdirs | |
370 | # those modules come from and builds special rtld-foo.os versions that | |
371 | # are compiled with special flags, and puts these modules into rtld-libc.a | |
372 | # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a. | |
373 | ||
374 | $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a | |
240e87c2 RM |
375 | @-rm -f $@T |
376 | $(reloc-link) -o $@.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T | |
ce460d04 | 377 | rm -f $@.o |
240e87c2 | 378 | mv -f $@T $@ |
ce460d04 RM |
379 | |
380 | $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile | |
b61c8aba | 381 | LC_ALL=C \ |
6461e577 RM |
382 | sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \ |
383 | $< | \ | |
ce460d04 RM |
384 | while read lib file; do \ |
385 | case $$lib in \ | |
386 | libc_pic.a) \ | |
b61c8aba | 387 | LC_ALL=C fgrep -l /$$file \ |
ce460d04 | 388 | $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \ |
b61c8aba | 389 | LC_ALL=C \ |
ce460d04 RM |
390 | sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\ |
391 | ;; \ | |
392 | */*.a) \ | |
393 | echo rtld-$${lib%%/*} += $$file ;; \ | |
394 | *) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \ | |
395 | esac; \ | |
396 | done > $@T | |
b61c8aba UD |
397 | echo rtld-subdirs = `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \ |
398 | | LC_ALL=C sort -u` >> $@T | |
ce460d04 RM |
399 | mv -f $@T $@ |
400 | ||
401 | $(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE | |
402 | $(MAKE) -f $< -f rtld-Rules | |
403 | ||
ce460d04 | 404 | $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a |
b350afab | 405 | $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' \ |
5896ffa8 UD |
406 | -Wl,-Map,$@.map |
407 | ||
408 | generated += librtld.map librtld.mk rtld-libc.a librtld.os.map | |
d66e34cd | 409 | |
4df8c11d UD |
410 | z-now-yes = -Wl,-z,now |
411 | ||
32e6df36 | 412 | $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) |
9ae10332 | 413 | $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \ |
4df8c11d | 414 | $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \ |
32e6df36 | 415 | $(filter-out $(map-file),$^) $(load-map-file) \ |
4e34ac6a RM |
416 | -Wl,-soname=$(rtld-installed-name) \ |
417 | -Wl,-defsym=_begin=0 | |
cb84d1e4 | 418 | readelf -s $@ \ |
0a80eb74 | 419 | | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' |
266180eb | 420 | |
c7562c74 | 421 | # interp.c exists just to get this string into the libraries. |
b30542fb UD |
422 | CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \ |
423 | -DNOT_IN_libc=1 | |
656f8223 | 424 | $(objpfx)interp.os: $(common-objpfx)config.make |
c7562c74 | 425 | |
1ef32c3d | 426 | ifneq (ld.so,$(rtld-installed-name)) |
afd4eb37 | 427 | # Make sure ld.so.1 exists in the build directory so we can link |
852fc4b9 RM |
428 | # against it. |
429 | $(objpfx)$(rtld-installed-name): $(objpfx)ld.so | |
430 | rm -f $@ | |
f332db02 | 431 | ln -s $(<F) $@ |
da2d1bc5 | 432 | generated += $(rtld-installed-name) |
852fc4b9 RM |
433 | endif |
434 | ||
fd26970f UD |
435 | # Build a file mentioning all trustworthy directories to look for shared |
436 | # libraries when using LD_LIBRARY_PATH in a setuid program. The user can | |
437 | # add directories to the list by defining $(user-defined-trusted-dirs) | |
438 | # before starting make. | |
6598ac30 UD |
439 | $(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @: |
440 | $(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig | |
1ef32c3d | 441 | $(make-target-directory) |
ab7eb292 UD |
442 | echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \ |
443 | | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T}; | |
ce460d04 | 444 | echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T} |
6598ac30 UD |
445 | $(move-if-change) ${@:st=T} ${@:st=h} |
446 | touch $@ | |
a986484f | 447 | CPPFLAGS-dl-load.c = -I$(objpfx). -I$(csu-objpfx). |
86d2c878 | 448 | |
9f2a9248 | 449 | ifeq (yes,$(build-shared)) |
73237de3 | 450 | $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force) |
460adbb8 | 451 | $(make-target-directory) |
925e31d9 | 452 | $(do-install-program) |
1ef32c3d | 453 | |
8d57beea | 454 | $(inst_slibdir)/$(rtld-installed-name): \ |
460adbb8 UD |
455 | $(inst_slibdir)/$(rtld-version-installed-name) \ |
456 | $(inst_slibdir)/libc-$(version).so | |
925e31d9 | 457 | $(make-shlib-link) |
b122c703 | 458 | |
5148d49f UD |
459 | # Special target called by parent to install just the dynamic linker. |
460 | .PHONY: ldso_install | |
461 | ldso_install: $(inst_slibdir)/$(rtld-installed-name) | |
9f2a9248 | 462 | endif |
5148d49f | 463 | |
cb343854 | 464 | |
926e512f RM |
465 | common-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \ |
466 | -e 's%@VERSION@%$(version)%g' | |
1ddf537f | 467 | sh-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%/bin/sh%g;s/\$$"/"/g' |
926e512f | 468 | bash-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%$(BASH)%g' \ |
4a33c2f5 | 469 | -e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g' |
cb343854 | 470 | |
84384f5b | 471 | ifneq ($(have-bash2),yes) |
cb343854 | 472 | ldd-shell = sh |
e2102c14 UD |
473 | else |
474 | ldd-shell = bash | |
cb343854 UD |
475 | endif |
476 | ||
477 | ifeq ($(ldd-rewrite-script),no) | |
478 | define gen-ldd | |
b61c8aba | 479 | LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new |
cb343854 | 480 | endef |
84384f5b | 481 | else |
cb343854 | 482 | define gen-ldd |
b61c8aba | 483 | LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< | LC_ALL=C sed -f $(ldd-rewrite-script) > $@.new |
cb343854 UD |
484 | endef |
485 | endif | |
486 | ||
926e512f | 487 | $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \ |
ee74a442 | 488 | $(common-objpfx)config.make |
cb343854 | 489 | $(gen-ldd) |
84384f5b UD |
490 | chmod 555 $@.new |
491 | mv -f $@.new $@ | |
cb343854 | 492 | |
aaff4ba9 | 493 | $(objpfx)sprof: $(libdl) |
94e365c6 | 494 | |
591e1ffb | 495 | $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) |
11988f8f UD |
496 | |
497 | $(objpfx)pldd: $(pldd-modules:%=$(objpfx)%.o) | |
498 | ||
8ca91b36 | 499 | SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' |
1a379ea0 | 500 | CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ |
11bf8ce1 | 501 | -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 |
8ca91b36 UD |
502 | CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) |
503 | CFLAGS-cache.c = $(SYSCONF-FLAGS) | |
591e1ffb | 504 | |
ce460d04 | 505 | CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1) |
0d01dace | 506 | |
9b014809 UD |
507 | test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) |
508 | generated += $(addsuffix .so,$(strip $(modules-names))) | |
482eec0d | 509 | |
e1e3ba54 | 510 | ifeq (yes,$(build-shared)) |
8c0fe290 | 511 | ifeq ($(cross-compiling),no) |
5a384a91 | 512 | tests: $(objpfx)tst-pathopt.out |
e1e3ba54 | 513 | endif |
8c0fe290 | 514 | endif |
5a384a91 | 515 | |
aaff4ba9 UD |
516 | $(objpfx)testobj1.so: $(libdl) |
517 | $(objpfx)testobj1_1.so: $(objpfx)testobj1.so $(libdl) | |
518 | $(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl) | |
519 | $(objpfx)testobj3.so: $(libdl) | |
520 | $(objpfx)testobj4.so: $(libdl) | |
521 | $(objpfx)testobj5.so: $(libdl) | |
e30f2b98 | 522 | $(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so $(libdl) |
e18db2b0 | 523 | $(objpfx)failobj.so: $(objpfx)testobj6.so |
84ddc586 UD |
524 | $(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so |
525 | $(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so | |
526 | $(objpfx)dep4.so: $(objpfx)dep3.so | |
2cb8cefb | 527 | $(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so |
917fd061 | 528 | $(objpfx)nextmod1.so: $(libdl) |
ceb579a3 UD |
529 | $(objpfx)neededobj1.so: $(libdl) |
530 | $(objpfx)neededobj2.so: $(objpfx)neededobj1.so $(libdl) | |
531 | $(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so $(libdl) | |
8edd9172 UD |
532 | $(objpfx)neededobj4.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ |
533 | $(objpfx)neededobj3.so $(libdl) | |
c77a4478 | 534 | $(objpfx)neededobj6.so: $(objpfx)neededobj5.so |
f6de2239 | 535 | $(objpfx)unload2mod.so: $(objpfx)unload2dep.so |
d785c366 | 536 | $(objpfx)ltglobmod2.so: $(libdl) |
b71e7ce8 | 537 | $(objpfx)firstobj.so: $(shared-thread-library) |
273a3cfb | 538 | $(objpfx)globalmod1.so: $(libdl) |
1826d793 UD |
539 | $(objpfx)reldep4mod1.so: $(objpfx)reldep4mod3.so |
540 | $(objpfx)reldep4mod2.so: $(objpfx)reldep4mod4.so | |
3fac0001 UD |
541 | $(objpfx)dblloadmod1.so: $(objpfx)dblloadmod3.so |
542 | $(objpfx)dblloadmod2.so: $(objpfx)dblloadmod3.so | |
c4bb124a UD |
543 | $(objpfx)reldepmod5.so: $(objpfx)reldepmod2.so |
544 | $(objpfx)reldepmod6.so: $(objpfx)reldepmod2.so | |
c47e78b1 UD |
545 | $(objpfx)reldep6mod1.so: $(objpfx)reldep6mod0.so |
546 | $(objpfx)reldep6mod2.so: $(objpfx)reldep6mod1.so | |
547 | $(objpfx)reldep6mod3.so: $(objpfx)reldep6mod2.so | |
548 | $(objpfx)reldep6mod4.so: $(objpfx)reldep6mod1.so | |
fc093be1 | 549 | $(objpfx)tst-tlsmod3.so: $(objpfx)tst-tlsmod2.so |
94c24227 UD |
550 | $(objpfx)tst-tlsmod8.so: $(objpfx)tst-tlsmod7.so |
551 | $(objpfx)tst-tlsmod10.so: $(objpfx)tst-tlsmod9.so | |
552 | $(objpfx)tst-tlsmod12.so: $(objpfx)tst-tlsmod11.so | |
541765b6 | 553 | $(objpfx)tst-tlsmod13a.so: $(objpfx)tst-tlsmod13.so |
aff4519d UD |
554 | # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED |
555 | $(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so | |
556 | $(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so | |
d26dfc60 MG |
557 | $(objpfx)tst-tls19mod1.so: $(objpfx)tst-tls19mod2.so $(objpfx)tst-tls19mod3.so |
558 | $(objpfx)tst-tls19mod3.so: $(objpfx)ld.so | |
556224ab | 559 | $(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so |
aff4519d UD |
560 | $(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so |
561 | $(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so | |
562 | $(objpfx)reldep9mod3.so: $(objpfx)reldep9mod1.so $(objpfx)reldep9mod2.so | |
fab0abb4 UD |
563 | $(objpfx)unload3mod1.so: $(objpfx)unload3mod3.so |
564 | $(objpfx)unload3mod2.so: $(objpfx)unload3mod3.so | |
565 | $(objpfx)unload3mod3.so: $(objpfx)unload3mod4.so | |
20fe49b9 UD |
566 | $(objpfx)unload4mod1.so: $(objpfx)unload4mod2.so $(objpfx)unload4mod3.so |
567 | $(objpfx)unload4mod2.so: $(objpfx)unload4mod4.so $(objpfx)unload4mod3.so | |
bfc832cc UD |
568 | $(objpfx)unload6mod1.so: $(libdl) |
569 | $(objpfx)unload6mod2.so: $(libdl) | |
570 | $(objpfx)unload6mod3.so: $(libdl) | |
1ee2ff20 UD |
571 | $(objpfx)unload7mod1.so: $(libdl) |
572 | $(objpfx)unload7mod2.so: $(objpfx)unload7mod1.so | |
968dad0a UD |
573 | $(objpfx)tst-initordera2.so: $(objpfx)tst-initordera1.so |
574 | $(objpfx)tst-initorderb2.so: $(objpfx)tst-initorderb1.so $(objpfx)tst-initordera2.so | |
575 | $(objpfx)tst-initordera3.so: $(objpfx)tst-initorderb2.so $(objpfx)tst-initorderb1.so | |
576 | $(objpfx)tst-initordera4.so: $(objpfx)tst-initordera3.so | |
577 | $(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so $(objpfx)tst-initorderb2.so | |
ceb579a3 | 578 | |
6ef518c3 RM |
579 | LDFLAGS-tst-tlsmod5.so = -nostdlib |
580 | LDFLAGS-tst-tlsmod6.so = -nostdlib | |
581 | ||
1a379ea0 UD |
582 | testobj1.so-no-z-defs = yes |
583 | testobj3.so-no-z-defs = yes | |
584 | testobj4.so-no-z-defs = yes | |
585 | testobj5.so-no-z-defs = yes | |
586 | testobj6.so-no-z-defs = yes | |
587 | failobj.so-no-z-defs = yes | |
588 | constload2.so-no-z-defs = yes | |
589 | constload3.so-no-z-defs = yes | |
590 | nodelmod1.so-no-z-defs = yes | |
591 | nodelmod2.so-no-z-defs = yes | |
592 | nodelmod4.so-no-z-defs = yes | |
593 | nodel2mod2.so-no-z-defs = yes | |
594 | reldepmod2.so-no-z-defs = yes | |
595 | reldepmod3.so-no-z-defs = yes | |
596 | reldepmod4.so-no-z-defs = yes | |
597 | reldep4mod4.so-no-z-defs = yes | |
598 | reldep4mod2.so-no-z-defs = yes | |
599 | ltglobmod2.so-no-z-defs = yes | |
600 | dblloadmod3.so-no-z-defs = yes | |
601 | tst-tlsmod1.so-no-z-defs = yes | |
602 | tst-tlsmod2.so-no-z-defs = yes | |
603 | tst-tlsmod3.so-no-z-defs = yes | |
604 | tst-tlsmod4.so-no-z-defs = yes | |
605 | tst-tlsmod7.so-no-z-defs = yes | |
606 | tst-tlsmod8.so-no-z-defs = yes | |
607 | tst-tlsmod9.so-no-z-defs = yes | |
608 | tst-tlsmod10.so-no-z-defs = yes | |
609 | tst-tlsmod12.so-no-z-defs = yes | |
99fe3b0e UD |
610 | tst-tlsmod14a.so-no-z-defs = yes |
611 | tst-tlsmod14b.so-no-z-defs = yes | |
167d5acc | 612 | tst-tlsmod15a.so-no-z-defs = yes |
4c533566 | 613 | tst-tlsmod16b.so-no-z-defs = yes |
1a379ea0 UD |
614 | circlemod2.so-no-z-defs = yes |
615 | circlemod3.so-no-z-defs = yes | |
616 | circlemod3a.so-no-z-defs = yes | |
617 | reldep8mod2.so-no-z-defs = yes | |
618 | reldep9mod1.so-no-z-defs = yes | |
fab0abb4 | 619 | unload3mod4.so-no-z-defs = yes |
20fe49b9 | 620 | unload4mod1.so-no-z-defs = yes |
2f083d75 | 621 | ifuncmod1.so-no-z-defs = yes |
3c30afc8 L |
622 | ifuncmod5.so-no-z-defs = yes |
623 | ifuncmod6.so-no-z-defs = yes | |
a334319f | 624 | |
5181d776 RM |
625 | ifeq ($(build-shared),yes) |
626 | # Build all the modules even when not actually running test programs. | |
627 | tests: $(test-modules) | |
628 | endif | |
629 | ||
aaff4ba9 | 630 | $(objpfx)loadtest: $(libdl) |
482eec0d UD |
631 | LDFLAGS-loadtest = -rdynamic |
632 | ||
633 | $(objpfx)loadtest.out: $(test-modules) | |
6bd06384 | 634 | |
ceb579a3 | 635 | $(objpfx)neededtest: $(libdl) |
ceb579a3 | 636 | $(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ |
8edd9172 | 637 | $(objpfx)neededobj3.so |
ceb579a3 | 638 | |
9807e540 UD |
639 | $(objpfx)neededtest2: $(libdl) |
640 | $(objpfx)neededtest2.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ | |
8edd9172 UD |
641 | $(objpfx)neededobj3.so |
642 | ||
643 | $(objpfx)neededtest3: $(libdl) | |
644 | $(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ | |
645 | $(objpfx)neededobj3.so $(objpfx)neededobj4.so | |
9807e540 | 646 | |
c77a4478 UD |
647 | neededtest4-ENV = LC_ALL=C LANGUAGE=C |
648 | $(objpfx)neededtest4: $(libdl) $(objpfx)neededobj1.so | |
649 | $(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so | |
650 | ||
aaff4ba9 | 651 | $(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so $(libdl) |
e18db2b0 | 652 | LDFLAGS-restest1 = -rdynamic |
6bd06384 | 653 | |
2373b30e UD |
654 | $(objpfx)restest2: $(libdl) |
655 | LDFLAGS-restest2 = -rdynamic | |
656 | ||
6bd06384 | 657 | $(objpfx)restest1.out: $(test-modules) |
3d91edb2 | 658 | |
e18db2b0 | 659 | preloadtest-preloads = testobj1 testobj2 testobj3 testobj4 testobj5 |
10584d2e | 660 | $(objpfx)preloadtest: $(objpfx)testobj6.so |
10584d2e | 661 | LDFLAGS-preloadtest = -rdynamic |
e18db2b0 UD |
662 | $(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so) |
663 | preloadtest-ENV = \ | |
664 | LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so))) | |
1e262312 | 665 | |
aaff4ba9 | 666 | $(objpfx)loadfail: $(libdl) |
1e262312 UD |
667 | LDFLAGS-loadfail = -rdynamic |
668 | ||
61e0617a UD |
669 | $(objpfx)loadfail.out: $(objpfx)failobj.so |
670 | ||
671 | $(objpfx)multiload: $(libdl) | |
672 | LDFLAGS-multiload = -rdynamic | |
9df54168 | 673 | CFLAGS-multiload.c = -DOBJDIR=\"$(elf-objpfx)\" |
61e0617a UD |
674 | |
675 | $(objpfx)multiload.out: $(objpfx)testobj1.so | |
dc5efe83 UD |
676 | |
677 | $(objpfx)origtest: $(libdl) | |
394679eb | 678 | LDFLAGS-origtest = -rdynamic |
dc5efe83 | 679 | $(objpfx)origtest.out: $(objpfx)testobj1.so |
ff5fad16 UD |
680 | |
681 | ifeq ($(have-thread-library),yes) | |
682 | $(objpfx)resolvfail: $(libdl) $(shared-thread-library) | |
683 | else | |
684 | $(objpfx)resolvfail: $(libdl) | |
685 | endif | |
19cf43be UD |
686 | |
687 | $(objpfx)constload1: $(libdl) | |
688 | $(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so | |
84ddc586 | 689 | |
6d78cd00 UD |
690 | $(objpfx)circleload1: $(libdl) |
691 | $(objpfx)circleload1.out: $(objpfx)circlemod1.so \ | |
692 | $(objpfx)circlemod1a.so | |
693 | ||
694 | $(objpfx)circlemod1.so: $(objpfx)circlemod2.so | |
695 | $(objpfx)circlemod2.so: $(objpfx)circlemod3.so | |
696 | $(objpfx)circlemod1a.so: $(objpfx)circlemod2a.so | |
697 | $(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so | |
698 | ||
84ddc586 UD |
699 | $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so) |
700 | ||
701 | $(objpfx)order.out: $(objpfx)order | |
702 | $(elf-objpfx)$(rtld-installed-name) \ | |
703 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
704 | $(objpfx)order > $@ | |
705 | (echo "0123456789" | cmp $@ -) > /dev/null | |
c1025c19 UD |
706 | |
707 | $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so) | |
708 | $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so) | |
709 | vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so) | |
5e61ef88 | 710 | |
1d4bf315 | 711 | $(objpfx)noload: $(objpfx)testobj1.so $(common-objpfx)dlfcn/libdl.so |
5e61ef88 UD |
712 | LDFLAGS-noload = -rdynamic |
713 | $(objpfx)noload.out: $(objpfx)testobj5.so | |
0fb7851f | 714 | |
4bff6e01 AS |
715 | $(objpfx)noload-mem: $(objpfx)noload.out |
716 | $(common-objpfx)malloc/mtrace $(objpfx)noload.mtrace > $@ | |
717 | noload-ENV = MALLOC_TRACE=$(objpfx)noload.mtrace | |
718 | ||
ad7534c8 | 719 | LDFLAGS-nodelete = -rdynamic |
0fb7851f | 720 | LDFLAGS-nodelmod1.so = -Wl,--enable-new-dtags,-z,nodelete |
2cb8cefb | 721 | LDFLAGS-nodelmod4.so = -Wl,--enable-new-dtags,-z,nodelete |
0fb7851f | 722 | $(objpfx)nodelete: $(libdl) |
2cb8cefb UD |
723 | $(objpfx)nodelete.out: $(objpfx)nodelmod1.so $(objpfx)nodelmod2.so \ |
724 | $(objpfx)nodelmod3.so | |
2f54c82d UD |
725 | |
726 | LDFLAGS-nodlopenmod.so = -Wl,--enable-new-dtags,-z,nodlopen | |
727 | $(objpfx)nodlopen: $(libdl) | |
728 | $(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so | |
fcacb36a | 729 | |
87837aac UD |
730 | $(objpfx)nodlopenmod2.so: $(objpfx)nodlopenmod.so |
731 | $(objpfx)nodlopen2: $(libdl) | |
732 | $(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so | |
733 | ||
137bca87 UD |
734 | $(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so |
735 | $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \ | |
736 | -L$(subst :, -L,$(rpath-link)) \ | |
737 | -Wl,-rpath-link=$(rpath-link) \ | |
738 | $< -Wl,-F,$(objpfx)filtmod2.so | |
fcacb36a | 739 | $(objpfx)filter: $(objpfx)filtmod1.so |
2b7238dd UD |
740 | |
741 | $(objpfx)unload: $(libdl) | |
742 | $(objpfx)unload.out: $(objpfx)unloadmod.so | |
743 | ||
744 | $(objpfx)reldep: $(libdl) | |
745 | $(objpfx)reldep.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod2.so | |
746 | ||
747 | $(objpfx)reldep2: $(libdl) | |
748 | $(objpfx)reldep2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so | |
749 | ||
750 | $(objpfx)reldep3: $(libdl) | |
751 | $(objpfx)reldep3.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so | |
917fd061 | 752 | |
1826d793 UD |
753 | $(objpfx)reldep4: $(libdl) |
754 | $(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so | |
755 | ||
917fd061 | 756 | $(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so $(libdl) |
f6de2239 UD |
757 | |
758 | $(objpfx)unload2: $(libdl) | |
759 | $(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so | |
d785c366 UD |
760 | |
761 | $(objpfx)lateglobal: $(libdl) | |
762 | $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so | |
5a384a91 UD |
763 | |
764 | $(objpfx)tst-pathopt: $(libdl) | |
765 | $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \ | |
766 | $(objpfx)pathoptobj.so | |
767 | $(SHELL) -e $< $(common-objpfx) | |
b71e7ce8 UD |
768 | |
769 | $(objpfx)initfirst: $(libdl) | |
770 | $(objpfx)initfirst.out: $(objpfx)firstobj.so | |
273a3cfb UD |
771 | |
772 | $(objpfx)global: $(objpfx)globalmod1.so | |
773 | $(objpfx)global.out: $(objpfx)reldepmod1.so | |
3fac0001 UD |
774 | |
775 | $(objpfx)dblload: $(libdl) | |
776 | $(objpfx)dblload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so | |
777 | ||
778 | $(objpfx)dblunload: $(libdl) | |
779 | $(objpfx)dblunload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so | |
c4bb124a UD |
780 | |
781 | $(objpfx)reldep5: $(libdl) | |
ac2d6e9b | 782 | $(objpfx)reldep5.out: $(objpfx)reldepmod5.so $(objpfx)reldepmod6.so |
c47e78b1 UD |
783 | |
784 | $(objpfx)reldep6: $(libdl) | |
785 | $(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so | |
2e36cb48 | 786 | |
a41d8a74 UD |
787 | $(objpfx)reldep7: $(libdl) |
788 | $(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so | |
789 | ||
cfaf5e56 UD |
790 | $(objpfx)reldep8: $(libdl) |
791 | $(objpfx)reldep8.out: $(objpfx)reldep8mod3.so | |
792 | ||
aff4519d UD |
793 | LDFLAGS-nodel2mod2.so = -Wl,--enable-new-dtags,-z,nodelete |
794 | $(objpfx)nodelete2: $(libdl) | |
795 | $(objpfx)nodelete2.out: $(objpfx)nodel2mod3.so | |
796 | ||
797 | $(objpfx)reldep9: $(libdl) | |
798 | $(objpfx)reldep9.out: $(objpfx)reldep9mod3.so | |
799 | ||
2e36cb48 | 800 | $(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so |
aed283dd UD |
801 | |
802 | $(objpfx)tst-tls4: $(libdl) | |
803 | $(objpfx)tst-tls4.out: $(objpfx)tst-tlsmod2.so | |
804 | ||
805 | $(objpfx)tst-tls5: $(libdl) | |
806 | $(objpfx)tst-tls5.out: $(objpfx)tst-tlsmod2.so | |
bb4cb252 UD |
807 | |
808 | $(objpfx)tst-tls6: $(libdl) | |
809 | $(objpfx)tst-tls6.out: $(objpfx)tst-tlsmod2.so | |
fc093be1 UD |
810 | |
811 | $(objpfx)tst-tls7: $(libdl) | |
812 | $(objpfx)tst-tls7.out: $(objpfx)tst-tlsmod3.so | |
ebda6173 UD |
813 | |
814 | $(objpfx)tst-tls8: $(libdl) | |
815 | $(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so | |
6ef518c3 RM |
816 | |
817 | $(objpfx)tst-tls9: $(libdl) | |
818 | $(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so | |
819 | ||
702e8f14 | 820 | $(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so $(objpfx)tst-tlsmod7.so |
94c24227 | 821 | |
702e8f14 | 822 | $(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so $(objpfx)tst-tlsmod9.so |
94c24227 | 823 | |
702e8f14 | 824 | $(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so $(objpfx)tst-tlsmod11.so |
94c24227 | 825 | |
541765b6 UD |
826 | $(objpfx)tst-tls13: $(libdl) |
827 | $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so | |
828 | ||
167d5acc UD |
829 | $(objpfx)tst-tls14: $(objpfx)tst-tlsmod14a.so $(libdl) |
830 | $(objpfx)tst-tls14.out: $(objpfx)tst-tlsmod14b.so | |
831 | ||
832 | $(objpfx)tst-tls15: $(libdl) | |
833 | $(objpfx)tst-tls15.out: $(objpfx)tst-tlsmod15a.so $(objpfx)tst-tlsmod15b.so | |
99fe3b0e | 834 | |
d78efd9f RM |
835 | $(objpfx)tst-tls-dlinfo: $(libdl) |
836 | $(objpfx)tst-tls-dlinfo.out: $(objpfx)tst-tlsmod2.so | |
837 | ||
838 | ||
839 | ||
4c533566 UD |
840 | $(objpfx)tst-tls16: $(libdl) |
841 | $(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so | |
842 | ||
60a23f5a UD |
843 | $(objpfx)tst-tls17: $(libdl) |
844 | $(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so | |
1f20b93a AS |
845 | $(patsubst %,$(objpfx)%.os,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.os: tst-tlsmod17a.c |
846 | $(compile-command.c) -DN=$* | |
847 | $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so | |
848 | $(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules)) | |
60a23f5a | 849 | |
41e25904 | 850 | $(objpfx)tst-tls18: $(libdl) |
1f20b93a AS |
851 | $(objpfx)tst-tls18.out: $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules)) |
852 | $(patsubst %,$(objpfx)%.os,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.os : tst-tlsmod18a.c | |
853 | $(compile-command.c) -DN=$* | |
854 | $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so | |
41e25904 | 855 | |
d26dfc60 MG |
856 | $(objpfx)tst-tls19: $(libdl) |
857 | $(objpfx)tst-tls19.out: $(objpfx)tst-tls19mod1.so | |
858 | ||
06f6ca90 | 859 | CFLAGS-tst-align.c = $(stack-align-test-flags) |
be184b1d | 860 | CFLAGS-tst-align2.c = $(stack-align-test-flags) |
06f6ca90 | 861 | CFLAGS-tst-alignmod.c = $(stack-align-test-flags) |
be184b1d | 862 | CFLAGS-tst-alignmod2.c = $(stack-align-test-flags) |
06f6ca90 UD |
863 | $(objpfx)tst-align: $(libdl) |
864 | $(objpfx)tst-align.out: $(objpfx)tst-alignmod.so | |
be184b1d | 865 | $(objpfx)tst-align2: $(objpfx)tst-alignmod2.so |
06f6ca90 | 866 | |
fab0abb4 UD |
867 | $(objpfx)unload3: $(libdl) |
868 | $(objpfx)unload3.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \ | |
869 | $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so | |
870 | ||
20fe49b9 UD |
871 | $(objpfx)unload4: $(libdl) |
872 | $(objpfx)unload4.out: $(objpfx)unload4mod1.so $(objpfx)unload4mod3.so | |
873 | ||
874 | $(objpfx)unload5: $(libdl) | |
875 | $(objpfx)unload5.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \ | |
876 | $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so | |
877 | ||
bfc832cc UD |
878 | $(objpfx)unload6: $(libdl) |
879 | $(objpfx)unload6.out: $(objpfx)unload6mod1.so $(objpfx)unload6mod2.so \ | |
880 | $(objpfx)unload6mod3.so | |
881 | ||
1ee2ff20 UD |
882 | $(objpfx)unload7: $(libdl) |
883 | $(objpfx)unload7.out: $(objpfx)unload7mod1.so $(objpfx)unload7mod2.so | |
884 | unload7-ENV = MALLOC_PERTURB_=85 | |
885 | ||
6ef518c3 RM |
886 | ifdef libdl |
887 | $(objpfx)tst-tls9-static: $(common-objpfx)dlfcn/libdl.a | |
888 | $(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so | |
889 | endif | |
dfe4c900 | 890 | |
2abf9ff1 RM |
891 | ifeq ($(have-z-execstack),yes) |
892 | $(objpfx)tst-execstack: $(libdl) | |
893 | $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so | |
894 | LDFLAGS-tst-execstack = -Wl,-z,noexecstack | |
895 | LDFLAGS-tst-execstack-mod = -Wl,-z,execstack | |
896 | ||
897 | $(objpfx)tst-execstack-needed: $(objpfx)tst-execstack-mod.so | |
898 | LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack | |
c70ba488 RM |
899 | |
900 | LDFLAGS-tst-execstack-prog = -Wl,-z,execstack | |
2abf9ff1 RM |
901 | endif |
902 | ||
dfe4c900 RM |
903 | $(objpfx)tst-array1.out: $(objpfx)tst-array1 |
904 | $(elf-objpfx)$(rtld-installed-name) \ | |
905 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
906 | $(objpfx)tst-array1 > $@ | |
907 | cmp $@ tst-array1.exp > /dev/null | |
908 | ||
43c59a70 UD |
909 | $(objpfx)tst-array1-static.out: $(objpfx)tst-array1-static |
910 | $(objpfx)tst-array1-static > $@ | |
911 | cmp $@ tst-array1.exp > /dev/null | |
912 | ||
dfe4c900 RM |
913 | $(objpfx)tst-array2: $(objpfx)tst-array2dep.so |
914 | $(objpfx)tst-array2.out: $(objpfx)tst-array2 | |
915 | $(elf-objpfx)$(rtld-installed-name) \ | |
916 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
917 | $(objpfx)tst-array2 > $@ | |
918 | cmp $@ tst-array2.exp > /dev/null | |
919 | ||
920 | $(objpfx)tst-array3.out: $(objpfx)tst-array3 | |
921 | $(elf-objpfx)$(rtld-installed-name) \ | |
922 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
923 | $(objpfx)tst-array3 > $@ | |
924 | cmp $@ tst-array1.exp > /dev/null | |
efd56f53 | 925 | |
62f29da7 UD |
926 | $(objpfx)tst-array4: $(libdl) |
927 | $(objpfx)tst-array4.out: $(objpfx)tst-array4 $(objpfx)tst-array2dep.so | |
928 | $(elf-objpfx)$(rtld-installed-name) \ | |
929 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
930 | $< > $@ | |
931 | cmp $@ tst-array4.exp > /dev/null | |
efd56f53 | 932 | |
04395c90 UD |
933 | $(objpfx)tst-array5: $(objpfx)tst-array5dep.so |
934 | $(objpfx)tst-array5.out: $(objpfx)tst-array5 | |
935 | $(elf-objpfx)$(rtld-installed-name) \ | |
936 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
937 | $(objpfx)tst-array5 > $@ | |
938 | cmp $@ tst-array5.exp > /dev/null | |
939 | ||
940 | $(objpfx)tst-array5-static.out: $(objpfx)tst-array5-static | |
941 | $(objpfx)tst-array5-static > $@ | |
942 | cmp $@ tst-array5-static.exp > /dev/null | |
943 | ||
7b91359b | 944 | CFLAGS-tst-pie1.c += $(pie-ccflag) |
f17ed1a9 | 945 | |
da62f81b | 946 | $(objpfx)tst-pie1: $(objpfx)tst-piemod1.so |
f17ed1a9 | 947 | |
e5ffa64a | 948 | check-textrel-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE |
efd56f53 UD |
949 | $(objpfx)check-textrel: check-textrel.c |
950 | $(native-compile) | |
951 | ||
68dc9497 AS |
952 | check-execstack-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -std=gnu99 \ |
953 | $(objpfx:%/=-I%) | |
954 | $(objpfx)check-execstack: check-execstack.c $(objpfx)check-execstack.h | |
955 | $(native-compile) | |
956 | $(objpfx)check-execstack.h: $(first-word $(wildcard $(sysdirs:%=%/stackinfo.h))) | |
30950a5f | 957 | $(make-target-directory) |
68dc9497 AS |
958 | { echo '#include <stackinfo.h>'; echo '@@@DEFAULT_STACK_PERMS@@@'; } | \ |
959 | $(CC) $(CFLAGS) $(CPPFLAGS) -E -x c-header - | \ | |
960 | sed -n -e 's/^@@@\(.*\)@@@/#define DEFAULT_STACK_PERMS \1/p' > $@T | |
961 | mv -f $@T $@ | |
962 | generated += check-execstack.h | |
774f5a30 | 963 | |
3baf2e9b UD |
964 | check-localplt-CFLAGS = -O -Wall -D_GNU_SOURCE -std=gnu99 |
965 | $(objpfx)check-localplt: check-localplt.c | |
966 | $(native-compile) | |
967 | ||
efd56f53 | 968 | ifeq (yes,$(build-shared)) |
774f5a30 | 969 | tests: $(objpfx)check-textrel.out $(objpfx)check-execstack.out |
efd56f53 | 970 | |
1f20b93a | 971 | all-built-dso = $(common-objpfx)libc.so \ |
68468076 UD |
972 | $(filter-out $(common-objpfx)linkobj/libc.so, \ |
973 | $(sort $(wildcard $(common-objpfx)*/lib*.so \ | |
974 | $(common-objpfx)iconvdata/*.so))) | |
1f20b93a AS |
975 | |
976 | $(objpfx)check-textrel.out: $(objpfx)check-textrel $(all-built-dso) | |
977 | $(dir $<)$(notdir $<) $(filter-out $<, $^) > $@ | |
efd56f53 | 978 | generated += check-textrel check-textrel.out |
bed12f78 | 979 | |
1f20b93a AS |
980 | $(objpfx)check-execstack.out: $(objpfx)check-execstack $(all-built-dso) |
981 | $(dir $<)$(notdir $<) $(filter-out $<, $^) > $@ | |
774f5a30 UD |
982 | generated += check-execstack check-execstack.out |
983 | ||
bed12f78 UD |
984 | $(objpfx)tst-dlmodcount: $(libdl) |
985 | $(objpfx)tst-dlmodcount.out: $(test-modules) | |
986 | ||
3baf2e9b | 987 | check-data := $(firstword $(wildcard \ |
a3d731d3 UD |
988 | $(foreach D,$(add-ons) scripts,\ |
989 | $(patsubst %,$(..)$D/data/localplt-%.data,\ | |
990 | $(abi-name) \ | |
991 | $(addsuffix -$(config-os),\ | |
992 | $(config-machine) \ | |
e85f1d6a RM |
993 | $(base-machine)) \ |
994 | generic)))) | |
995 | ||
3baf2e9b UD |
996 | tests: $(objpfx)check-localplt.out |
997 | ||
d9266ea0 UD |
998 | ifeq ($(have-thread-library),yes) |
999 | thread-dso := $(filter-out %_nonshared.a, $(shared-thread-library)) | |
1000 | endif | |
1001 | ||
773e305e RM |
1002 | $(objpfx)check-localplt.out: $(objpfx)check-localplt \ |
1003 | $(common-objpfx)libc.so \ | |
a3d731d3 UD |
1004 | $(common-objpfx)math/libm.so $(thread-dso) \ |
1005 | $(common-objpfx)rt/librt.so \ | |
1006 | $(common-objpfx)dlfcn/libdl.so \ | |
17756df3 UD |
1007 | $(common-objpfx)resolv/libresolv.so \ |
1008 | $(common-objpfx)crypt/libcrypt.so \ | |
d9266ea0 | 1009 | $(check-data) |
773e305e | 1010 | $(dir $<)$(notdir $<) $(filter-out $< $(check-data),$^) | \ |
d9266ea0 UD |
1011 | LC_ALL=C sort | \ |
1012 | diff -u $(check-data) - > $@ | |
3baf2e9b | 1013 | endif |
28977c2c UD |
1014 | |
1015 | $(objpfx)tst-dlopenrpathmod.so: $(libdl) | |
1016 | $(objpfx)tst-dlopenrpath: $(objpfx)tst-dlopenrpathmod.so $(libdl) | |
1017 | CFLAGS-tst-dlopenrpath.c += -DPFX=\"$(objpfx)\" | |
1018 | LDFLAGS-tst-dlopenrpathmod.so += -Wl,-rpath,\$$ORIGIN/test-subdir | |
1019 | $(objpfx)tst-dlopenrpath.out: $(objpfx)firstobj.so | |
1fc07491 UD |
1020 | |
1021 | $(objpfx)tst-deep1mod2.so: $(objpfx)tst-deep1mod3.so | |
1022 | $(objpfx)tst-deep1: $(libdl) $(objpfx)tst-deep1mod1.so | |
1023 | $(objpfx)tst-deep1.out: $(objpfx)tst-deep1mod2.so | |
1024 | LDFLAGS-tst-deep1 += -rdynamic | |
1025 | tst-deep1mod3.so-no-z-defs = yes | |
c0f62c56 UD |
1026 | |
1027 | $(objpfx)tst-dlmopen1mod.so: $(libdl) | |
1028 | $(objpfx)tst-dlmopen1: $(libdl) | |
1029 | $(objpfx)tst-dlmopen1.out: $(objpfx)tst-dlmopen1mod.so | |
1030 | ||
1031 | $(objpfx)tst-dlmopen2: $(libdl) | |
1032 | $(objpfx)tst-dlmopen2.out: $(objpfx)tst-dlmopen1mod.so | |
b1f68750 UD |
1033 | |
1034 | $(objpfx)tst-dlmopen3: $(libdl) | |
1035 | $(objpfx)tst-dlmopen3.out: $(objpfx)tst-dlmopen1mod.so | |
9dcafc55 UD |
1036 | |
1037 | $(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so | |
1038 | tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so | |
fab0abb4 | 1039 | |
cafdfdb6 RM |
1040 | $(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so |
1041 | tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so | |
1042 | ||
167d5ed5 L |
1043 | $(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so |
1044 | $(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so | |
1045 | tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so | |
1046 | ||
b0ecde3a L |
1047 | $(objpfx)tst-audit4: $(objpfx)tst-auditmod4a.so |
1048 | $(objpfx)tst-audit4.out: $(objpfx)tst-auditmod4b.so | |
1049 | tst-audit4-ENV = LD_AUDIT=$(objpfx)tst-auditmod4b.so | |
1050 | ||
1051 | $(objpfx)tst-audit5: $(objpfx)tst-auditmod5a.so | |
1052 | $(objpfx)tst-audit5.out: $(objpfx)tst-auditmod5b.so | |
1053 | tst-audit5-ENV = LD_AUDIT=$(objpfx)tst-auditmod5b.so | |
1054 | ||
4e1e2f42 L |
1055 | $(objpfx)tst-audit6: $(objpfx)tst-auditmod6a.so |
1056 | $(objpfx)tst-audit6.out: $(objpfx)tst-auditmod6b.so \ | |
1057 | $(objpfx)tst-auditmod6c.so | |
1058 | tst-audit6-ENV = LD_AUDIT=$(objpfx)tst-auditmod6b.so:$(objpfx)tst-auditmod6c.so | |
1059 | ||
1060 | $(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so | |
1061 | $(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so | |
1062 | tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so | |
1063 | ||
fab0abb4 UD |
1064 | $(objpfx)tst-global1: $(libdl) |
1065 | $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so | |
3d786f19 UD |
1066 | |
1067 | $(objpfx)order2: $(libdl) | |
1068 | $(objpfx)order2.out: $(objpfx)order2 $(objpfx)order2mod1.so \ | |
1069 | $(objpfx)order2mod2.so | |
1070 | $(elf-objpfx)$(rtld-installed-name) \ | |
1071 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
1072 | $(objpfx)order2 > $@ | |
1073 | (echo "12345" | cmp $@ -) > /dev/null | |
1074 | $(objpfx)order2mod1.so: $(objpfx)order2mod4.so | |
1075 | $(objpfx)order2mod4.so: $(objpfx)order2mod3.so | |
1076 | $(objpfx)order2mod2.so: $(objpfx)order2mod3.so | |
1077 | order2mod2.so-no-z-defs = yes | |
35f1e827 UD |
1078 | |
1079 | tst-stackguard1-ARGS = --command "$(built-program-cmd) --child" | |
1080 | tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child" | |
2e0fc40c UD |
1081 | |
1082 | $(objpfx)tst-leaks1: $(libdl) | |
1083 | $(objpfx)tst-leaks1-mem: $(objpfx)tst-leaks1.out | |
1084 | $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@ | |
1085 | ||
1086 | tst-leaks1-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1.mtrace | |
93b53ca2 UD |
1087 | |
1088 | $(objpfx)tst-addr1: $(libdl) | |
ffd0e1b7 UD |
1089 | |
1090 | $(objpfx)tst-thrlock: $(libdl) $(shared-thread-library) | |
2f083d75 L |
1091 | |
1092 | CFLAGS-ifuncmain1pic.c += $(pic-ccflag) | |
1093 | CFLAGS-ifuncmain1picstatic.c += $(pic-ccflag) | |
1094 | CFLAGS-ifuncmain1staticpic.c += $(pic-ccflag) | |
1095 | CFLAGS-ifuncdep1pic.c += $(pic-ccflag) | |
1096 | CFLAGS-ifuncmain1vispic.c += $(pic-ccflag) | |
1097 | CFLAGS-ifuncmain2pic.c += $(pic-ccflag) | |
1098 | CFLAGS-ifuncmain2picstatic.c += $(pic-ccflag) | |
1099 | CFLAGS-ifuncdep2pic.c += $(pic-ccflag) | |
1100 | CFLAGS-ifuncmain4picstatic.c += $(pic-ccflag) | |
3c30afc8 L |
1101 | CFLAGS-ifuncmain5pic.c += $(pic-ccflag) |
1102 | CFLAGS-ifuncmain5picstatic.c += $(pic-ccflag) | |
1103 | CFLAGS-ifuncmain5staticpic.c += $(pic-ccflag) | |
1104 | CFLAGS-ifuncdep5pic.c += $(pic-ccflag) | |
1105 | CFLAGS-ifuncmain7pic.c += $(pic-ccflag) | |
1106 | CFLAGS-ifuncmain7picstatic.c += $(pic-ccflag) | |
2f083d75 L |
1107 | |
1108 | LDFLAGS-ifuncmain3 = -Wl,-export-dynamic | |
1109 | ||
2f083d75 L |
1110 | CFLAGS-ifuncmain1pie.c += $(pie-ccflag) |
1111 | CFLAGS-ifuncmain1vispie.c += $(pie-ccflag) | |
3c30afc8 L |
1112 | CFLAGS-ifuncmain1staticpie.c += $(pie-ccflag) |
1113 | CFLAGS-ifuncmain5pie.c += $(pie-ccflag) | |
1114 | CFLAGS-ifuncmain6pie.c += $(pie-ccflag) | |
1115 | CFLAGS-ifuncmain7pie.c += $(pie-ccflag) | |
2f083d75 | 1116 | |
da62f81b AS |
1117 | $(objpfx)ifuncmain1pie: $(objpfx)ifuncmod1.so |
1118 | $(objpfx)ifuncmain1staticpie: $(objpfx)ifuncdep1pic.o | |
1119 | $(objpfx)ifuncmain1vispie: $(objpfx)ifuncmod1.so | |
1120 | $(objpfx)ifuncmain5pie: $(objpfx)ifuncmod5.so | |
1121 | $(objpfx)ifuncmain6pie: $(objpfx)ifuncmod6.so | |
2f083d75 L |
1122 | |
1123 | $(objpfx)ifuncmain1: $(addprefix $(objpfx),ifuncmod1.so) | |
1124 | $(objpfx)ifuncmain1pic: $(addprefix $(objpfx),ifuncmod1.so) | |
1125 | $(objpfx)ifuncmain1staticpic: $(addprefix $(objpfx),ifuncdep1pic.o) | |
1126 | $(objpfx)ifuncmain1static: $(addprefix $(objpfx),ifuncdep1.o) | |
1127 | $(objpfx)ifuncmain1picstatic: $(addprefix $(objpfx),ifuncdep1pic.o) | |
1128 | $(objpfx)ifuncmain1vis: $(addprefix $(objpfx),ifuncmod1.so) | |
1129 | $(objpfx)ifuncmain1vispic: $(addprefix $(objpfx),ifuncmod1.so) | |
1130 | $(objpfx)ifuncmain2: $(addprefix $(objpfx),ifuncdep2.o) | |
1131 | $(objpfx)ifuncmain2pic: $(addprefix $(objpfx),ifuncdep2pic.o) | |
1132 | $(objpfx)ifuncmain2static: $(addprefix $(objpfx),ifuncdep2.o) | |
1133 | $(objpfx)ifuncmain2picstatic: $(addprefix $(objpfx),ifuncdep2pic.o) | |
1134 | ||
1135 | $(objpfx)ifuncmain3: $(libdl) | |
1136 | $(objpfx)ifuncmain3.out: $(objpfx)ifuncmod3.so | |
3c30afc8 L |
1137 | |
1138 | $(objpfx)ifuncmain5: $(addprefix $(objpfx),ifuncmod5.so) | |
1139 | $(objpfx)ifuncmain5pic: $(addprefix $(objpfx),ifuncmod5.so) | |
1140 | $(objpfx)ifuncmain5static: $(addprefix $(objpfx),ifuncdep5.o) | |
1141 | $(objpfx)ifuncmain5staticpic: $(addprefix $(objpfx),ifuncdep5pic.o) | |
1142 | $(objpfx)ifuncmain5picstatic: $(addprefix $(objpfx),ifuncdep5pic.o) | |
415ac3df UD |
1143 | |
1144 | $(objpfx)tst-unique1: $(libdl) | |
1145 | $(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \ | |
1146 | $(objpfx)tst-unique1mod2.so | |
1147 | ||
1148 | $(objpfx)tst-unique2: $(libdl) $(objpfx)tst-unique2mod1.so | |
1149 | $(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so | |
b0ecde3a | 1150 | |
028478fa UD |
1151 | $(objpfx)tst-unique3: $(libdl) $(objpfx)tst-unique3lib.so |
1152 | $(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so | |
33f85a3f | 1153 | |
320a5dc0 PB |
1154 | $(objpfx)tst-unique4: $(objpfx)tst-unique4lib.so |
1155 | ||
968dad0a UD |
1156 | $(objpfx)tst-initorder.out: $(objpfx)tst-initorder |
1157 | $(elf-objpfx)${rtld-installed-name} \ | |
1158 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
1159 | $< > $@ | |
1160 | cmp $@ tst-initorder.exp > /dev/null | |
1161 | ||
e888bcbe AS |
1162 | $(objpfx)tst-initorder2: $(objpfx)tst-initorder2a.so $(objpfx)tst-initorder2d.so $(objpfx)tst-initorder2c.so |
1163 | $(objpfx)tst-initorder2a.so: $(objpfx)tst-initorder2b.so | |
1164 | $(objpfx)tst-initorder2b.so: $(objpfx)tst-initorder2c.so | |
1165 | $(objpfx)tst-initorder2c.so: $(objpfx)tst-initorder2d.so | |
1166 | define o-iterator-doit | |
1167 | $(objpfx)tst-initorder2$o.os: tst-initorder2.c; \ | |
1168 | $$(compile-command.c) -DNAME=\"$o\" | |
1169 | endef | |
1170 | object-suffixes-left := a b c d | |
1171 | include $(o-iterator) | |
1172 | ||
1173 | $(objpfx)tst-initorder2.out: $(objpfx)tst-initorder2 | |
1174 | $(elf-objpfx)${rtld-installed-name} \ | |
1175 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
1176 | $< > $@ | |
1177 | cmp $@ tst-initorder2.exp > /dev/null | |
1178 | ||
b0ecde3a | 1179 | ifeq (yes,$(config-cflags-avx)) |
435b95eb L |
1180 | AVX-CFLAGS=-mavx |
1181 | ifeq (yes,$(config-cflags-novzeroupper)) | |
1182 | AVX-CFLAGS+=-mno-vzeroupper | |
1183 | endif | |
1184 | CFLAGS-tst-audit4.c += $(AVX-CFLAGS) | |
1185 | CFLAGS-tst-auditmod4a.c += $(AVX-CFLAGS) | |
1186 | CFLAGS-tst-auditmod4b.c += $(AVX-CFLAGS) | |
1187 | CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS) | |
1188 | CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS) | |
1189 | CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS) | |
b0ecde3a | 1190 | endif |