]>
Commit | Line | Data |
---|---|---|
aff4519d | 1 | # Copyright (C) 1995-2002, 2003 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 | ||
019e7a64 | 23 | headers = elf.h bits/elfclass.h link.h |
39ab0fdf | 24 | routines = $(dl-routines) dl-open dl-close dl-support dl-iteratephdr \ |
27d640be | 25 | dl-addr enbl-secure dl-profstub \ |
ce460d04 | 26 | dl-origin dl-libc dl-sym dl-tsd |
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 \ |
3996f34b | 31 | runtime error init fini debug misc \ |
2abf9ff1 RM |
32 | version profile conflict tls origin \ |
33 | execstack) | |
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. |
27d640be | 36 | elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin |
266180eb RM |
37 | |
38 | # ld.so uses those routines, plus some special stuff for being the program | |
39 | # interpreter and operating independent of libc. | |
ce460d04 | 40 | rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal |
e39e6956 | 41 | all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines) |
b79f74cd | 42 | |
ce460d04 RM |
43 | distribute := rtld-Rules \ |
44 | $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \ | |
b3ed8219 | 45 | dl-cache.h dl-hash.h soinit.c sofini.c ldd.bash.in \ |
94e365c6 UD |
46 | genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \ |
47 | dl-librecon.h interp.c sln.c dl-dst.h hp-timing.h \ | |
c77ec56d | 48 | do-lookup.h dl-lookupcfg.h sprof.c gen-trusted-dirs.awk \ |
94e365c6 | 49 | testobj1.c testobj2.c testobj3.c testobj4.c testobj5.c \ |
2b7238dd | 50 | testobj6.c testobj1_1.c failobj.c unloadmod.c \ |
84ddc586 | 51 | ldconfig.h ldconfig.c cache.c readlib.c readelflib.c \ |
e340a2a2 | 52 | chroot_canon.c gccframe.h \ |
74955460 | 53 | dep1.c dep2.c dep3.c dep4.c dl-dtprocnum.h unsecvars.h \ |
afa0569f | 54 | vismain.c vismod1.c vismod2.c vismod3.c \ |
74dd1fee UD |
55 | constload2.c constload3.c filtmod1.c filtmod2.c \ |
56 | nodlopenmod.c nodelete.c nodelmod1.c nodelmod2.c \ | |
2b7238dd | 57 | nodelmod3.c nodelmod4.c nodlopen.c dl-osinfo.h \ |
917fd061 | 58 | reldepmod1.c reldepmod2.c reldepmod3.c reldepmod4.c \ |
c4bb124a | 59 | reldepmod5.c reldepmod6.c \ |
1826d793 | 60 | reldep4mod1.c reldep4mod2.c reldep4mod3.c reldep4mod4.c \ |
8bc6161d | 61 | nextmod1.c nextmod2.c pathoptobj.c tst-pathopt.sh \ |
5ab7f7c1 | 62 | neededobj1.c neededobj2.c neededobj3.c neededobj4.c \ |
421f0c9d | 63 | neededobj5.c neededobj6.c firstobj.c \ |
1a511d31 | 64 | unload2mod.c unload2dep.c ltglobmod1.c ltglobmod2.c \ |
3fac0001 | 65 | testobj.h vismod.h globalmod1.c \ |
ab92bebd UD |
66 | dblloadmod1.c dblloadmod2.c dblloadmod3.c \ |
67 | reldep6mod4.c reldep6mod3.c reldep6mod2.c reldep6mod1.c \ | |
a41d8a74 | 68 | reldep6mod0.c reldep7mod1.c reldep7mod2.c \ |
ab92bebd | 69 | unwind-dw2.c unwind-dw2-fde.c unwind.h unwind-pe.h \ |
2cef4257 | 70 | unwind-dw2-fde.h dwarf2.h dl-procinfo.c tls.h dl-tls.h \ |
4c53d221 | 71 | tst-tlsmod1.c tst-tlsmod2.c tst-tlsmod3.c tst-tlsmod4.c \ |
94c24227 UD |
72 | tst-tlsmod5.c tst-tlsmod6.c tst-tlsmod7.c tst-tlsmod8.c \ |
73 | tst-tlsmod9.c tst-tlsmod10.c tst-tlsmod11.c \ | |
06f6ca90 | 74 | tst-tlsmod12.c tst-tls10.h tst-alignmod.c \ |
4c53d221 UD |
75 | circlemod1.c circlemod1a.c circlemod2.c circlemod2a.c \ |
76 | circlemod3.c circlemod3a.c nodlopenmod2.c \ | |
cfaf5e56 | 77 | tls-macros.h \ |
aff4519d UD |
78 | reldep8mod1.c reldep8mod2.c reldep8mod3.c \ |
79 | nodel2mod1.c nodel2mod2.c nodel2mod3.c \ | |
ec503662 UD |
80 | reldep9.c reldep9mod1.c reldep9mod2.c reldep9mod3.c \ |
81 | tst-array1.exp tst-array2.exp tst-array4.exp \ | |
82 | tst-array2dep.c \ | |
bed12f78 | 83 | tst-execstack-mod.c tst-dlmodcount.c \ |
ec503662 | 84 | check-textrel.c dl-sysdep.h |
d66e34cd | 85 | |
80b54217 | 86 | CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables |
bb958f59 | 87 | CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables |
e07bb02a | 88 | CFLAGS-dl-iterate-phdr.c = $(uses-callbacks) |
80b54217 | 89 | |
05f732b3 UD |
90 | include ../Makeconfig |
91 | ||
74bd2300 | 92 | ifeq ($(unwind-find-fde),yes) |
a0dcb689 UD |
93 | routines += unwind-dw2-fde-glibc |
94 | shared-only-routines = unwind-dw2-fde-glibc | |
74bd2300 UD |
95 | endif |
96 | ||
40c4c9b5 | 97 | before-compile = $(objpfx)trusted-dirs.h |
5a384a91 UD |
98 | generated := trusted-dirs.h trusted-dirs.st for-renamed/renamed.so |
99 | generated-dirs := for-renamed | |
fd26970f | 100 | |
bdd421cc | 101 | ifeq ($(versioning),yes) |
a0edd63e | 102 | ld-map = $(common-objpfx)ld.map |
bdd421cc UD |
103 | endif |
104 | ||
d66e34cd | 105 | ifeq (yes,$(build-shared)) |
b79f74cd | 106 | extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os |
40c4c9b5 | 107 | generated += librtld.os dl-allobjs.os ld.so ldd |
8d57beea | 108 | install-others = $(inst_slibdir)/$(rtld-installed-name) |
6c3ebebd | 109 | install-bin-script = ldd |
f49bc43f | 110 | endif |
86d2c878 | 111 | |
9d141cae | 112 | others = sprof sln |
6c3ebebd | 113 | install-bin = sprof |
9d141cae UD |
114 | others-static = sln |
115 | install-rootsbin = sln | |
ae828bc6 | 116 | |
591e1ffb | 117 | ifeq (yes,$(use-ldconfig)) |
99ac5e47 | 118 | ifeq (yes,$(build-shared)) |
e1586792 | 119 | others-static += ldconfig |
da2d1bc5 | 120 | others += ldconfig |
9d141cae | 121 | install-rootsbin += ldconfig |
591e1ffb | 122 | |
b4a555d6 | 123 | ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon |
591e1ffb UD |
124 | extra-objs += $(ldconfig-modules:=.o) |
125 | ||
126 | # To find xmalloc.c and xstrdup.c | |
127 | vpath %.c ../locale/programs | |
128 | ||
99ac5e47 | 129 | endif |
1ef32c3d UD |
130 | endif |
131 | ||
6ef518c3 | 132 | tests = tst-tls1 tst-tls2 tst-tls9 |
dfe4c900 | 133 | ifeq (yes,$(have-initfini-array)) |
62f29da7 | 134 | tests += tst-array1 tst-array2 tst-array3 tst-array4 |
dfe4c900 | 135 | endif |
db265313 RM |
136 | ifeq (yes,$(build-static)) |
137 | tests-static = tst-tls1-static tst-tls2-static | |
6ef518c3 RM |
138 | ifeq (yesyesyes,$(build-static)$(build-shared)$(elf)) |
139 | tests-static += tst-tls9-static | |
140 | tst-tls9-static-ENV = \ | |
141 | LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn | |
142 | endif | |
db265313 RM |
143 | tests += $(tests-static) |
144 | endif | |
2f512715 | 145 | ifeq (yes,$(build-shared)) |
db265313 RM |
146 | tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ |
147 | constload1 order $(tests-vis-$(have-protected)) noload filter unload \ | |
148 | reldep reldep2 reldep3 reldep4 $(tests-nodelete-$(have-z-nodelete)) \ | |
149 | $(tests-nodlopen-$(have-z-nodlopen)) neededtest neededtest2 \ | |
150 | neededtest3 neededtest4 unload2 lateglobal initfirst global \ | |
cfaf5e56 | 151 | restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \ |
94c24227 | 152 | circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \ |
2abf9ff1 | 153 | tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-align \ |
bed12f78 | 154 | $(tests-execstack-$(have-z-execstack)) tst-dlmodcount |
aff4519d | 155 | # reldep9 |
5a384a91 | 156 | test-srcs = tst-pathopt |
c1025c19 | 157 | tests-vis-yes = vismain |
aff4519d | 158 | tests-nodelete-yes = nodelete nodelete2 |
87837aac | 159 | tests-nodlopen-yes = nodlopen nodlopen2 |
c70ba488 | 160 | tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog |
2f512715 | 161 | endif |
a25f2023 | 162 | modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ |
2b7238dd | 163 | testobj1_1 failobj constload2 constload3 unloadmod \ |
0fb7851f | 164 | dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \ |
2f54c82d | 165 | $(modules-nodelete-$(have-z-nodelete)) \ |
2b7238dd | 166 | $(modules-nodlopen-$(have-z-nodlopen)) filtmod1 filtmod2 \ |
ceb579a3 | 167 | reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \ |
1826d793 | 168 | reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \ |
8edd9172 | 169 | neededobj1 neededobj2 neededobj3 neededobj4 \ |
273a3cfb | 170 | neededobj5 neededobj6 firstobj globalmod1 \ |
3fac0001 | 171 | unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \ |
c47e78b1 | 172 | dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \ |
2e36cb48 | 173 | reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \ |
a41d8a74 | 174 | reldep7mod1 reldep7mod2 \ |
6d78cd00 | 175 | tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \ |
94c24227 UD |
176 | tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \ |
177 | tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \ | |
99fe3b0e | 178 | tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \ |
6d78cd00 | 179 | circlemod1 circlemod1a circlemod2 circlemod2a \ |
cfaf5e56 | 180 | circlemod3 circlemod3a \ |
aff4519d | 181 | reldep8mod1 reldep8mod2 reldep8mod3 \ |
06f6ca90 | 182 | reldep9mod1 reldep9mod2 reldep9mod3 \ |
2abf9ff1 | 183 | tst-alignmod $(modules-execstack-$(have-z-execstack)) |
dfe4c900 RM |
184 | ifeq (yes,$(have-initfini-array)) |
185 | modules-names += tst-array2dep | |
186 | endif | |
c1025c19 | 187 | modules-vis-yes = vismod1 vismod2 vismod3 |
aff4519d UD |
188 | modules-nodelete-yes = nodelmod1 nodelmod2 nodelmod3 nodelmod4 \ |
189 | nodel2mod1 nodel2mod2 nodel2mod3 | |
87837aac | 190 | modules-nodlopen-yes = nodlopenmod nodlopenmod2 |
2abf9ff1 | 191 | modules-execstack-yes = tst-execstack-mod |
9b014809 | 192 | extra-objs += $(addsuffix .os,$(strip $(modules-names))) |
724d8c3f RM |
193 | # We need this variable to be sure the test modules get the right CPPFLAGS. |
194 | test-extras += $(modules-names) | |
dc18d4d8 | 195 | |
01cc0be6 | 196 | include ../Rules |
d66e34cd | 197 | |
fd54683c RM |
198 | check-abi: check-abi-ld |
199 | update-abi: update-abi-ld | |
200 | ||
1ef32c3d | 201 | ifeq (yes,$(build-shared)) |
a89d30d4 RM |
202 | # Make sure these things are built in the `make lib' pass so they can be used |
203 | # to run programs during the `make others' pass. | |
204 | lib-noranlib: $(objpfx)$(rtld-installed-name) \ | |
205 | $(addprefix $(objpfx),$(extra-objs)) | |
206 | endif | |
207 | ||
db2286f6 | 208 | # Command to link into a larger single relocatable object. |
ce460d04 | 209 | reloc-link = $(LINK.o) -nostdlib -nostartfiles -r |
db2286f6 | 210 | |
b79f74cd | 211 | $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os) |
ce460d04 | 212 | $(reloc-link) -o $@ $^ |
db2286f6 | 213 | |
86d2c878 | 214 | # Link together the dynamic linker into a single relocatable object. |
ce460d04 RM |
215 | # First we do a link against libc_pic.a just to get a link map, |
216 | # and discard the object produced by that link. From the link map | |
217 | # we can glean all the libc modules that need to go into the dynamic | |
218 | # linker. Then we do a recursive make that goes into all the subdirs | |
219 | # those modules come from and builds special rtld-foo.os versions that | |
220 | # are compiled with special flags, and puts these modules into rtld-libc.a | |
221 | # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a. | |
222 | ||
223 | $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a | |
240e87c2 RM |
224 | @-rm -f $@T |
225 | $(reloc-link) -o $@.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T | |
ce460d04 | 226 | rm -f $@.o |
240e87c2 | 227 | mv -f $@T $@ |
ce460d04 RM |
228 | |
229 | $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile | |
b61c8aba | 230 | LC_ALL=C \ |
6461e577 RM |
231 | sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \ |
232 | $< | \ | |
ce460d04 RM |
233 | while read lib file; do \ |
234 | case $$lib in \ | |
235 | libc_pic.a) \ | |
b61c8aba | 236 | LC_ALL=C fgrep -l /$$file \ |
ce460d04 | 237 | $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \ |
b61c8aba | 238 | LC_ALL=C \ |
ce460d04 RM |
239 | sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\ |
240 | ;; \ | |
241 | */*.a) \ | |
242 | echo rtld-$${lib%%/*} += $$file ;; \ | |
243 | *) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \ | |
244 | esac; \ | |
245 | done > $@T | |
b61c8aba UD |
246 | echo rtld-subdirs = `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \ |
247 | | LC_ALL=C sort -u` >> $@T | |
ce460d04 RM |
248 | mv -f $@T $@ |
249 | ||
250 | $(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE | |
251 | $(MAKE) -f $< -f rtld-Rules | |
252 | ||
ce460d04 | 253 | $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a |
5896ffa8 UD |
254 | $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' \ |
255 | -Wl,-Map,$@.map | |
256 | ||
257 | generated += librtld.map librtld.mk rtld-libc.a librtld.os.map | |
d66e34cd | 258 | |
32e6df36 | 259 | $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) |
070cadeb | 260 | @rm -f $@.lds |
32e6df36 | 261 | $(LINK.o) -nostdlib -nostartfiles -shared \ |
9ae10332 | 262 | $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \ |
b61c8aba | 263 | LC_ALL=C \ |
32e6df36 UD |
264 | sed -e '/^=========/,/^=========/!d;/^=========/d' \ |
265 | -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \ | |
070cadeb | 266 | > $@.lds |
9ae10332 RM |
267 | $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \ |
268 | $(LDFLAGS-rtld) -Wl,-z,defs \ | |
32e6df36 | 269 | $(filter-out $(map-file),$^) $(load-map-file) \ |
070cadeb | 270 | -Wl,-soname=$(rtld-installed-name) -T $@.lds |
32e6df36 | 271 | rm -f $@.lds |
266180eb | 272 | |
c7562c74 UD |
273 | # interp.c exists just to get this string into the libraries. |
274 | CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' | |
656f8223 | 275 | $(objpfx)interp.os: $(common-objpfx)config.make |
c7562c74 | 276 | |
1ef32c3d | 277 | ifneq (ld.so,$(rtld-installed-name)) |
afd4eb37 | 278 | # Make sure ld.so.1 exists in the build directory so we can link |
852fc4b9 RM |
279 | # against it. |
280 | $(objpfx)$(rtld-installed-name): $(objpfx)ld.so | |
281 | rm -f $@ | |
f332db02 | 282 | ln -s $(<F) $@ |
da2d1bc5 | 283 | generated += $(rtld-installed-name) |
852fc4b9 RM |
284 | endif |
285 | ||
fd26970f UD |
286 | # Build a file mentioning all trustworthy directories to look for shared |
287 | # libraries when using LD_LIBRARY_PATH in a setuid program. The user can | |
288 | # add directories to the list by defining $(user-defined-trusted-dirs) | |
289 | # before starting make. | |
6598ac30 UD |
290 | $(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @: |
291 | $(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig | |
1ef32c3d | 292 | $(make-target-directory) |
ab7eb292 UD |
293 | echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \ |
294 | | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T}; | |
ce460d04 | 295 | echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T} |
6598ac30 UD |
296 | $(move-if-change) ${@:st=T} ${@:st=h} |
297 | touch $@ | |
a986484f | 298 | CPPFLAGS-dl-load.c = -I$(objpfx). -I$(csu-objpfx). |
86d2c878 | 299 | |
9f2a9248 | 300 | ifeq (yes,$(build-shared)) |
73237de3 | 301 | $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force) |
460adbb8 | 302 | $(make-target-directory) |
925e31d9 | 303 | $(do-install-program) |
1ef32c3d | 304 | |
8d57beea | 305 | $(inst_slibdir)/$(rtld-installed-name): \ |
460adbb8 UD |
306 | $(inst_slibdir)/$(rtld-version-installed-name) \ |
307 | $(inst_slibdir)/libc-$(version).so | |
925e31d9 | 308 | $(make-shlib-link) |
b122c703 | 309 | |
5148d49f UD |
310 | # Special target called by parent to install just the dynamic linker. |
311 | .PHONY: ldso_install | |
312 | ldso_install: $(inst_slibdir)/$(rtld-installed-name) | |
9f2a9248 | 313 | endif |
5148d49f | 314 | |
cb343854 | 315 | |
926e512f RM |
316 | common-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \ |
317 | -e 's%@VERSION@%$(version)%g' | |
1ddf537f | 318 | sh-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%/bin/sh%g;s/\$$"/"/g' |
926e512f | 319 | bash-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%$(BASH)%g' \ |
4a33c2f5 | 320 | -e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g' |
cb343854 | 321 | |
84384f5b | 322 | ifneq ($(have-bash2),yes) |
cb343854 | 323 | ldd-shell = sh |
e2102c14 UD |
324 | else |
325 | ldd-shell = bash | |
cb343854 UD |
326 | endif |
327 | ||
328 | ifeq ($(ldd-rewrite-script),no) | |
329 | define gen-ldd | |
b61c8aba | 330 | LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new |
cb343854 | 331 | endef |
84384f5b | 332 | else |
cb343854 | 333 | define gen-ldd |
b61c8aba | 334 | LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< | LC_ALL=C sed -f $(ldd-rewrite-script) > $@.new |
cb343854 UD |
335 | endef |
336 | endif | |
337 | ||
926e512f | 338 | $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \ |
ee74a442 | 339 | $(common-objpfx)config.make |
cb343854 | 340 | $(gen-ldd) |
84384f5b UD |
341 | chmod 555 $@.new |
342 | mv -f $@.new $@ | |
cb343854 | 343 | |
aaff4ba9 | 344 | $(objpfx)sprof: $(libdl) |
94e365c6 | 345 | |
591e1ffb | 346 | $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) |
8ca91b36 | 347 | SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' |
1a379ea0 | 348 | CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ |
11bf8ce1 | 349 | -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 |
8ca91b36 UD |
350 | CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) |
351 | CFLAGS-cache.c = $(SYSCONF-FLAGS) | |
591e1ffb | 352 | |
ce460d04 | 353 | CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1) |
0d01dace | 354 | |
9b014809 UD |
355 | test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) |
356 | generated += $(addsuffix .so,$(strip $(modules-names))) | |
482eec0d | 357 | |
e1e3ba54 | 358 | ifeq (yes,$(build-shared)) |
8c0fe290 | 359 | ifeq ($(cross-compiling),no) |
5a384a91 | 360 | tests: $(objpfx)tst-pathopt.out |
e1e3ba54 | 361 | endif |
8c0fe290 | 362 | endif |
5a384a91 | 363 | |
aaff4ba9 UD |
364 | $(objpfx)testobj1.so: $(libdl) |
365 | $(objpfx)testobj1_1.so: $(objpfx)testobj1.so $(libdl) | |
366 | $(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl) | |
367 | $(objpfx)testobj3.so: $(libdl) | |
368 | $(objpfx)testobj4.so: $(libdl) | |
369 | $(objpfx)testobj5.so: $(libdl) | |
e30f2b98 | 370 | $(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so $(libdl) |
e18db2b0 | 371 | $(objpfx)failobj.so: $(objpfx)testobj6.so |
84ddc586 UD |
372 | $(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so |
373 | $(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so | |
374 | $(objpfx)dep4.so: $(objpfx)dep3.so | |
2cb8cefb | 375 | $(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so |
917fd061 | 376 | $(objpfx)nextmod1.so: $(libdl) |
ceb579a3 UD |
377 | $(objpfx)neededobj1.so: $(libdl) |
378 | $(objpfx)neededobj2.so: $(objpfx)neededobj1.so $(libdl) | |
379 | $(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so $(libdl) | |
8edd9172 UD |
380 | $(objpfx)neededobj4.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ |
381 | $(objpfx)neededobj3.so $(libdl) | |
c77a4478 | 382 | $(objpfx)neededobj6.so: $(objpfx)neededobj5.so |
f6de2239 | 383 | $(objpfx)unload2mod.so: $(objpfx)unload2dep.so |
d785c366 | 384 | $(objpfx)ltglobmod2.so: $(libdl) |
b71e7ce8 | 385 | $(objpfx)firstobj.so: $(shared-thread-library) |
273a3cfb | 386 | $(objpfx)globalmod1.so: $(libdl) |
1826d793 UD |
387 | $(objpfx)reldep4mod1.so: $(objpfx)reldep4mod3.so |
388 | $(objpfx)reldep4mod2.so: $(objpfx)reldep4mod4.so | |
3fac0001 UD |
389 | $(objpfx)dblloadmod1.so: $(objpfx)dblloadmod3.so |
390 | $(objpfx)dblloadmod2.so: $(objpfx)dblloadmod3.so | |
c4bb124a UD |
391 | $(objpfx)reldepmod5.so: $(objpfx)reldepmod2.so |
392 | $(objpfx)reldepmod6.so: $(objpfx)reldepmod2.so | |
c47e78b1 UD |
393 | $(objpfx)reldep6mod1.so: $(objpfx)reldep6mod0.so |
394 | $(objpfx)reldep6mod2.so: $(objpfx)reldep6mod1.so | |
395 | $(objpfx)reldep6mod3.so: $(objpfx)reldep6mod2.so | |
396 | $(objpfx)reldep6mod4.so: $(objpfx)reldep6mod1.so | |
fc093be1 | 397 | $(objpfx)tst-tlsmod3.so: $(objpfx)tst-tlsmod2.so |
94c24227 UD |
398 | $(objpfx)tst-tlsmod8.so: $(objpfx)tst-tlsmod7.so |
399 | $(objpfx)tst-tlsmod10.so: $(objpfx)tst-tlsmod9.so | |
400 | $(objpfx)tst-tlsmod12.so: $(objpfx)tst-tlsmod11.so | |
541765b6 | 401 | $(objpfx)tst-tlsmod13a.so: $(objpfx)tst-tlsmod13.so |
aff4519d UD |
402 | # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED |
403 | $(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so | |
404 | $(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so | |
556224ab | 405 | $(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so |
aff4519d UD |
406 | $(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so |
407 | $(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so | |
408 | $(objpfx)reldep9mod3.so: $(objpfx)reldep9mod1.so $(objpfx)reldep9mod2.so | |
ceb579a3 | 409 | |
6ef518c3 RM |
410 | LDFLAGS-tst-tlsmod5.so = -nostdlib |
411 | LDFLAGS-tst-tlsmod6.so = -nostdlib | |
412 | ||
1a379ea0 UD |
413 | testobj1.so-no-z-defs = yes |
414 | testobj3.so-no-z-defs = yes | |
415 | testobj4.so-no-z-defs = yes | |
416 | testobj5.so-no-z-defs = yes | |
417 | testobj6.so-no-z-defs = yes | |
418 | failobj.so-no-z-defs = yes | |
419 | constload2.so-no-z-defs = yes | |
420 | constload3.so-no-z-defs = yes | |
421 | nodelmod1.so-no-z-defs = yes | |
422 | nodelmod2.so-no-z-defs = yes | |
423 | nodelmod4.so-no-z-defs = yes | |
424 | nodel2mod2.so-no-z-defs = yes | |
425 | reldepmod2.so-no-z-defs = yes | |
426 | reldepmod3.so-no-z-defs = yes | |
427 | reldepmod4.so-no-z-defs = yes | |
428 | reldep4mod4.so-no-z-defs = yes | |
429 | reldep4mod2.so-no-z-defs = yes | |
430 | ltglobmod2.so-no-z-defs = yes | |
431 | dblloadmod3.so-no-z-defs = yes | |
432 | tst-tlsmod1.so-no-z-defs = yes | |
433 | tst-tlsmod2.so-no-z-defs = yes | |
434 | tst-tlsmod3.so-no-z-defs = yes | |
435 | tst-tlsmod4.so-no-z-defs = yes | |
436 | tst-tlsmod7.so-no-z-defs = yes | |
437 | tst-tlsmod8.so-no-z-defs = yes | |
438 | tst-tlsmod9.so-no-z-defs = yes | |
439 | tst-tlsmod10.so-no-z-defs = yes | |
440 | tst-tlsmod12.so-no-z-defs = yes | |
99fe3b0e UD |
441 | tst-tlsmod14a.so-no-z-defs = yes |
442 | tst-tlsmod14b.so-no-z-defs = yes | |
1a379ea0 UD |
443 | circlemod2.so-no-z-defs = yes |
444 | circlemod3.so-no-z-defs = yes | |
445 | circlemod3a.so-no-z-defs = yes | |
446 | reldep8mod2.so-no-z-defs = yes | |
447 | reldep9mod1.so-no-z-defs = yes | |
448 | ||
10b36b41 AJ |
449 | # filtmod1.so has a special rule |
450 | $(filter-out $(objpfx)filtmod1.so, $(test-modules)): $(objpfx)%.so: $(objpfx)%.os | |
482eec0d UD |
451 | $(build-module) |
452 | ||
5181d776 RM |
453 | ifeq ($(build-shared),yes) |
454 | # Build all the modules even when not actually running test programs. | |
455 | tests: $(test-modules) | |
456 | endif | |
457 | ||
aaff4ba9 | 458 | $(objpfx)loadtest: $(libdl) |
482eec0d UD |
459 | LDFLAGS-loadtest = -rdynamic |
460 | ||
461 | $(objpfx)loadtest.out: $(test-modules) | |
6bd06384 | 462 | |
ceb579a3 | 463 | $(objpfx)neededtest: $(libdl) |
ceb579a3 | 464 | $(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ |
8edd9172 | 465 | $(objpfx)neededobj3.so |
ceb579a3 | 466 | |
9807e540 UD |
467 | $(objpfx)neededtest2: $(libdl) |
468 | $(objpfx)neededtest2.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ | |
8edd9172 UD |
469 | $(objpfx)neededobj3.so |
470 | ||
471 | $(objpfx)neededtest3: $(libdl) | |
472 | $(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ | |
473 | $(objpfx)neededobj3.so $(objpfx)neededobj4.so | |
9807e540 | 474 | |
c77a4478 UD |
475 | neededtest4-ENV = LC_ALL=C LANGUAGE=C |
476 | $(objpfx)neededtest4: $(libdl) $(objpfx)neededobj1.so | |
477 | $(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so | |
478 | ||
aaff4ba9 | 479 | $(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so $(libdl) |
e18db2b0 | 480 | LDFLAGS-restest1 = -rdynamic |
6bd06384 | 481 | |
2373b30e UD |
482 | $(objpfx)restest2: $(libdl) |
483 | LDFLAGS-restest2 = -rdynamic | |
484 | ||
6bd06384 | 485 | $(objpfx)restest1.out: $(test-modules) |
3d91edb2 | 486 | |
e18db2b0 | 487 | preloadtest-preloads = testobj1 testobj2 testobj3 testobj4 testobj5 |
10584d2e | 488 | $(objpfx)preloadtest: $(objpfx)testobj6.so |
10584d2e | 489 | LDFLAGS-preloadtest = -rdynamic |
e18db2b0 UD |
490 | $(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so) |
491 | preloadtest-ENV = \ | |
492 | LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so))) | |
1e262312 | 493 | |
aaff4ba9 | 494 | $(objpfx)loadfail: $(libdl) |
1e262312 UD |
495 | LDFLAGS-loadfail = -rdynamic |
496 | ||
61e0617a UD |
497 | $(objpfx)loadfail.out: $(objpfx)failobj.so |
498 | ||
499 | $(objpfx)multiload: $(libdl) | |
500 | LDFLAGS-multiload = -rdynamic | |
9df54168 | 501 | CFLAGS-multiload.c = -DOBJDIR=\"$(elf-objpfx)\" |
61e0617a UD |
502 | |
503 | $(objpfx)multiload.out: $(objpfx)testobj1.so | |
dc5efe83 UD |
504 | |
505 | $(objpfx)origtest: $(libdl) | |
394679eb | 506 | LDFLAGS-origtest = -rdynamic |
dc5efe83 | 507 | $(objpfx)origtest.out: $(objpfx)testobj1.so |
ff5fad16 UD |
508 | |
509 | ifeq ($(have-thread-library),yes) | |
510 | $(objpfx)resolvfail: $(libdl) $(shared-thread-library) | |
511 | else | |
512 | $(objpfx)resolvfail: $(libdl) | |
513 | endif | |
19cf43be UD |
514 | |
515 | $(objpfx)constload1: $(libdl) | |
516 | $(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so | |
84ddc586 | 517 | |
6d78cd00 UD |
518 | $(objpfx)circleload1: $(libdl) |
519 | $(objpfx)circleload1.out: $(objpfx)circlemod1.so \ | |
520 | $(objpfx)circlemod1a.so | |
521 | ||
522 | $(objpfx)circlemod1.so: $(objpfx)circlemod2.so | |
523 | $(objpfx)circlemod2.so: $(objpfx)circlemod3.so | |
524 | $(objpfx)circlemod1a.so: $(objpfx)circlemod2a.so | |
525 | $(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so | |
526 | ||
84ddc586 UD |
527 | $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so) |
528 | ||
529 | $(objpfx)order.out: $(objpfx)order | |
530 | $(elf-objpfx)$(rtld-installed-name) \ | |
531 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
532 | $(objpfx)order > $@ | |
533 | (echo "0123456789" | cmp $@ -) > /dev/null | |
c1025c19 UD |
534 | |
535 | $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so) | |
536 | $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so) | |
537 | vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so) | |
5e61ef88 UD |
538 | |
539 | $(objpfx)noload: $(objpfx)testobj1.so | |
540 | LDFLAGS-noload = -rdynamic | |
541 | $(objpfx)noload.out: $(objpfx)testobj5.so | |
0fb7851f | 542 | |
ad7534c8 | 543 | LDFLAGS-nodelete = -rdynamic |
0fb7851f | 544 | LDFLAGS-nodelmod1.so = -Wl,--enable-new-dtags,-z,nodelete |
2cb8cefb | 545 | LDFLAGS-nodelmod4.so = -Wl,--enable-new-dtags,-z,nodelete |
0fb7851f | 546 | $(objpfx)nodelete: $(libdl) |
2cb8cefb UD |
547 | $(objpfx)nodelete.out: $(objpfx)nodelmod1.so $(objpfx)nodelmod2.so \ |
548 | $(objpfx)nodelmod3.so | |
2f54c82d UD |
549 | |
550 | LDFLAGS-nodlopenmod.so = -Wl,--enable-new-dtags,-z,nodlopen | |
551 | $(objpfx)nodlopen: $(libdl) | |
552 | $(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so | |
fcacb36a | 553 | |
87837aac UD |
554 | $(objpfx)nodlopenmod2.so: $(objpfx)nodlopenmod.so |
555 | $(objpfx)nodlopen2: $(libdl) | |
556 | $(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so | |
557 | ||
137bca87 UD |
558 | $(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so |
559 | $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \ | |
560 | -L$(subst :, -L,$(rpath-link)) \ | |
561 | -Wl,-rpath-link=$(rpath-link) \ | |
562 | $< -Wl,-F,$(objpfx)filtmod2.so | |
fcacb36a | 563 | $(objpfx)filter: $(objpfx)filtmod1.so |
2b7238dd UD |
564 | |
565 | $(objpfx)unload: $(libdl) | |
566 | $(objpfx)unload.out: $(objpfx)unloadmod.so | |
567 | ||
568 | $(objpfx)reldep: $(libdl) | |
569 | $(objpfx)reldep.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod2.so | |
570 | ||
571 | $(objpfx)reldep2: $(libdl) | |
572 | $(objpfx)reldep2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so | |
573 | ||
574 | $(objpfx)reldep3: $(libdl) | |
575 | $(objpfx)reldep3.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so | |
917fd061 | 576 | |
1826d793 UD |
577 | $(objpfx)reldep4: $(libdl) |
578 | $(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so | |
579 | ||
917fd061 | 580 | $(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so $(libdl) |
f6de2239 UD |
581 | |
582 | $(objpfx)unload2: $(libdl) | |
583 | $(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so | |
d785c366 UD |
584 | |
585 | $(objpfx)lateglobal: $(libdl) | |
586 | $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so | |
5a384a91 UD |
587 | |
588 | $(objpfx)tst-pathopt: $(libdl) | |
589 | $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \ | |
590 | $(objpfx)pathoptobj.so | |
591 | $(SHELL) -e $< $(common-objpfx) | |
b71e7ce8 UD |
592 | |
593 | $(objpfx)initfirst: $(libdl) | |
594 | $(objpfx)initfirst.out: $(objpfx)firstobj.so | |
273a3cfb UD |
595 | |
596 | $(objpfx)global: $(objpfx)globalmod1.so | |
597 | $(objpfx)global.out: $(objpfx)reldepmod1.so | |
3fac0001 UD |
598 | |
599 | $(objpfx)dblload: $(libdl) | |
600 | $(objpfx)dblload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so | |
601 | ||
602 | $(objpfx)dblunload: $(libdl) | |
603 | $(objpfx)dblunload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so | |
c4bb124a UD |
604 | |
605 | $(objpfx)reldep5: $(libdl) | |
606 | $(objpfx)reldep5.out: $(objpfx)reldepmod5.so $(objpfx)reldepmod5.so | |
c47e78b1 UD |
607 | |
608 | $(objpfx)reldep6: $(libdl) | |
609 | $(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so | |
2e36cb48 | 610 | |
a41d8a74 UD |
611 | $(objpfx)reldep7: $(libdl) |
612 | $(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so | |
613 | ||
cfaf5e56 UD |
614 | $(objpfx)reldep8: $(libdl) |
615 | $(objpfx)reldep8.out: $(objpfx)reldep8mod3.so | |
616 | ||
aff4519d UD |
617 | LDFLAGS-nodel2mod2.so = -Wl,--enable-new-dtags,-z,nodelete |
618 | $(objpfx)nodelete2: $(libdl) | |
619 | $(objpfx)nodelete2.out: $(objpfx)nodel2mod3.so | |
620 | ||
621 | $(objpfx)reldep9: $(libdl) | |
622 | $(objpfx)reldep9.out: $(objpfx)reldep9mod3.so | |
623 | ||
2e36cb48 | 624 | $(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so |
aed283dd UD |
625 | |
626 | $(objpfx)tst-tls4: $(libdl) | |
627 | $(objpfx)tst-tls4.out: $(objpfx)tst-tlsmod2.so | |
628 | ||
629 | $(objpfx)tst-tls5: $(libdl) | |
630 | $(objpfx)tst-tls5.out: $(objpfx)tst-tlsmod2.so | |
bb4cb252 UD |
631 | |
632 | $(objpfx)tst-tls6: $(libdl) | |
633 | $(objpfx)tst-tls6.out: $(objpfx)tst-tlsmod2.so | |
fc093be1 UD |
634 | |
635 | $(objpfx)tst-tls7: $(libdl) | |
636 | $(objpfx)tst-tls7.out: $(objpfx)tst-tlsmod3.so | |
ebda6173 UD |
637 | |
638 | $(objpfx)tst-tls8: $(libdl) | |
639 | $(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so | |
6ef518c3 RM |
640 | |
641 | $(objpfx)tst-tls9: $(libdl) | |
642 | $(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so | |
643 | ||
94c24227 UD |
644 | $(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so |
645 | ||
646 | $(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so | |
647 | ||
648 | $(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so | |
649 | ||
541765b6 UD |
650 | $(objpfx)tst-tls13: $(libdl) |
651 | $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so | |
652 | ||
99fe3b0e UD |
653 | $(objpfx)tst-tls14: $(objpfx)tst-tlsmod14a.so $(libdl) |
654 | $(objpfx)tst-tls14.out:$(objpfx)tst-tlsmod14b.so | |
655 | ||
06f6ca90 UD |
656 | CFLAGS-tst-align.c = $(stack-align-test-flags) |
657 | CFLAGS-tst-alignmod.c = $(stack-align-test-flags) | |
658 | $(objpfx)tst-align: $(libdl) | |
659 | $(objpfx)tst-align.out: $(objpfx)tst-alignmod.so | |
660 | ||
6ef518c3 RM |
661 | ifdef libdl |
662 | $(objpfx)tst-tls9-static: $(common-objpfx)dlfcn/libdl.a | |
663 | $(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so | |
664 | endif | |
dfe4c900 | 665 | |
2abf9ff1 RM |
666 | ifeq ($(have-z-execstack),yes) |
667 | $(objpfx)tst-execstack: $(libdl) | |
668 | $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so | |
669 | LDFLAGS-tst-execstack = -Wl,-z,noexecstack | |
670 | LDFLAGS-tst-execstack-mod = -Wl,-z,execstack | |
671 | ||
672 | $(objpfx)tst-execstack-needed: $(objpfx)tst-execstack-mod.so | |
673 | LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack | |
c70ba488 RM |
674 | |
675 | LDFLAGS-tst-execstack-prog = -Wl,-z,execstack | |
2abf9ff1 RM |
676 | endif |
677 | ||
dfe4c900 RM |
678 | $(objpfx)tst-array1.out: $(objpfx)tst-array1 |
679 | $(elf-objpfx)$(rtld-installed-name) \ | |
680 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
681 | $(objpfx)tst-array1 > $@ | |
682 | cmp $@ tst-array1.exp > /dev/null | |
683 | ||
684 | $(objpfx)tst-array2: $(objpfx)tst-array2dep.so | |
685 | $(objpfx)tst-array2.out: $(objpfx)tst-array2 | |
686 | $(elf-objpfx)$(rtld-installed-name) \ | |
687 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
688 | $(objpfx)tst-array2 > $@ | |
689 | cmp $@ tst-array2.exp > /dev/null | |
690 | ||
691 | $(objpfx)tst-array3.out: $(objpfx)tst-array3 | |
692 | $(elf-objpfx)$(rtld-installed-name) \ | |
693 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
694 | $(objpfx)tst-array3 > $@ | |
695 | cmp $@ tst-array1.exp > /dev/null | |
efd56f53 | 696 | |
62f29da7 UD |
697 | $(objpfx)tst-array4: $(libdl) |
698 | $(objpfx)tst-array4.out: $(objpfx)tst-array4 $(objpfx)tst-array2dep.so | |
699 | $(elf-objpfx)$(rtld-installed-name) \ | |
700 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
701 | $< > $@ | |
702 | cmp $@ tst-array4.exp > /dev/null | |
efd56f53 | 703 | |
e5ffa64a | 704 | check-textrel-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE |
efd56f53 UD |
705 | $(objpfx)check-textrel: check-textrel.c |
706 | $(native-compile) | |
707 | ||
708 | ifeq (yes,$(build-shared)) | |
709 | tests: $(objpfx)check-textrel.out | |
710 | ||
711 | $(objpfx)check-textrel.out: $(objpfx)check-textrel | |
712 | $(dir $<)$(notdir $<) $(common-objpfx)libc.so \ | |
b4c98dc4 UD |
713 | $(sort $(wildcard $(common-objpfx)*/lib*.so \ |
714 | $(common-objpfx)iconvdata/*.so)) > $@ | |
efd56f53 | 715 | generated += check-textrel check-textrel.out |
bed12f78 UD |
716 | |
717 | $(objpfx)tst-dlmodcount: $(libdl) | |
718 | $(objpfx)tst-dlmodcount.out: $(test-modules) | |
719 | ||
efd56f53 | 720 | endif |