]>
Commit | Line | Data |
---|---|---|
688903eb | 1 | # Copyright (C) 1995-2018 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 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 PE |
15 | # License along with the GNU C Library; if not, see |
16 | # <http://www.gnu.org/licenses/>. | |
01cc0be6 | 17 | |
3db52d94 UD |
18 | # Makefile for elf subdirectory of GNU C Library. |
19 | ||
d66e34cd RM |
20 | subdir := elf |
21 | ||
f57f8055 RM |
22 | include ../Makeconfig |
23 | ||
9fbdeb41 | 24 | headers = elf.h bits/elfclass.h link.h bits/link.h |
ac9e0e5e | 25 | routines = $(all-dl-routines) dl-support dl-iteratephdr \ |
d61ef735 | 26 | dl-addr dl-addr-obj enbl-secure dl-profstub \ |
9d7a3741 L |
27 | dl-origin dl-libc dl-sym dl-sysdep dl-error \ |
28 | dl-reloc-static-pie | |
266180eb RM |
29 | |
30 | # The core dynamic linking functions are in libc for the static and | |
31 | # profiled libraries. | |
53cea63e | 32 | dl-routines = $(addprefix dl-,load lookup object reloc deps hwcaps \ |
9e78f6f6 | 33 | runtime init fini debug misc \ |
eb73083e | 34 | version profile tls origin scope \ |
52a01100 | 35 | execstack open close trampoline \ |
c2c299fd | 36 | exception sort-maps) |
f57f8055 RM |
37 | ifeq (yes,$(use-ldconfig)) |
38 | dl-routines += dl-cache | |
39 | endif | |
67e58f39 | 40 | |
6765d5d3 | 41 | ifneq (no,$(have-tunables)) |
67e58f39 | 42 | dl-routines += dl-tunables |
6765d5d3 | 43 | tunables-type = $(addprefix TUNABLES_FRONTEND_,$(have-tunables)) |
36975e8e | 44 | CPPFLAGS-dl-tunables.c += -DTUNABLES_FRONTEND=$(tunables-type) |
9dd409a5 SP |
45 | |
46 | # Make sure that the compiler does not insert any library calls in tunables | |
47 | # code paths. | |
48 | ifeq (yes,$(have-loop-to-function)) | |
36975e8e | 49 | CFLAGS-dl-tunables.c += -fno-tree-loop-distribute-patterns |
9dd409a5 | 50 | endif |
67e58f39 SP |
51 | endif |
52 | ||
b79f74cd | 53 | all-dl-routines = $(dl-routines) $(sysdep-dl-routines) |
266180eb | 54 | # But they are absent from the shared libc, because that code is in ld.so. |
368a8dec | 55 | elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \ |
9d7a3741 | 56 | dl-sysdep dl-exception dl-reloc-static-pie |
266180eb RM |
57 | |
58 | # ld.so uses those routines, plus some special stuff for being the program | |
59 | # interpreter and operating independent of libc. | |
9e78f6f6 | 60 | rtld-routines = rtld $(all-dl-routines) dl-sysdep dl-environ dl-minimal \ |
eb73083e | 61 | dl-error-minimal dl-conflict |
e39e6956 | 62 | all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines) |
b79f74cd | 63 | |
36975e8e L |
64 | CFLAGS-dl-runtime.c += -fexceptions -fasynchronous-unwind-tables |
65 | CFLAGS-dl-lookup.c += -fexceptions -fasynchronous-unwind-tables | |
66 | CFLAGS-dl-iterate-phdr.c += $(uses-callbacks) | |
80b54217 | 67 | |
995635f9 NA |
68 | # Compile rtld itself without stack protection. |
69 | # Also compile all routines in the static library that are elided from | |
70 | # the shared libc because they are in libc.a in the same way. | |
71 | ||
72 | define elide-stack-protector | |
73 | $(if $(filter $(@F),$(patsubst %,%$(1),$(2))), $(no-stack-protector)) | |
74 | endef | |
75 | ||
76 | CFLAGS-.o += $(call elide-stack-protector,.o,$(elide-routines.os)) | |
77 | CFLAGS-.op += $(call elide-stack-protector,.op,$(elide-routines.os)) | |
78 | CFLAGS-.os += $(call elide-stack-protector,.os,$(all-rtld-routines)) | |
79 | ||
74bd2300 | 80 | ifeq ($(unwind-find-fde),yes) |
a0dcb689 | 81 | routines += unwind-dw2-fde-glibc |
44094580 | 82 | shared-only-routines += unwind-dw2-fde-glibc |
74bd2300 UD |
83 | endif |
84 | ||
f08e9a26 RM |
85 | before-compile += $(objpfx)trusted-dirs.h |
86 | generated += trusted-dirs.h trusted-dirs.st for-renamed/renamed.so | |
87 | generated-dirs += for-renamed | |
fd26970f | 88 | |
3f2e46a4 | 89 | ifeq ($(build-shared),yes) |
a0edd63e | 90 | ld-map = $(common-objpfx)ld.map |
bdd421cc UD |
91 | endif |
92 | ||
d66e34cd | 93 | ifeq (yes,$(build-shared)) |
b79f74cd | 94 | extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os |
40c4c9b5 | 95 | generated += librtld.os dl-allobjs.os ld.so ldd |
aaa8cb4b | 96 | install-others = $(inst_rtlddir)/$(rtld-installed-name) |
6c3ebebd | 97 | install-bin-script = ldd |
f49bc43f | 98 | endif |
86d2c878 | 99 | |
fe658845 RM |
100 | others = sprof sln |
101 | install-bin = sprof | |
9d141cae UD |
102 | others-static = sln |
103 | install-rootsbin = sln | |
95f5a9a8 JM |
104 | sln-modules := static-stubs |
105 | extra-objs += $(sln-modules:=.o) | |
ae828bc6 | 106 | |
591e1ffb | 107 | ifeq (yes,$(use-ldconfig)) |
99ac5e47 | 108 | ifeq (yes,$(build-shared)) |
e1586792 | 109 | others-static += ldconfig |
da2d1bc5 | 110 | others += ldconfig |
9d141cae | 111 | install-rootsbin += ldconfig |
591e1ffb | 112 | |
95f5a9a8 | 113 | ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon static-stubs |
591e1ffb | 114 | extra-objs += $(ldconfig-modules:=.o) |
7b3ce395 | 115 | others-extras = $(ldconfig-modules) |
6103ae3b TS |
116 | endif |
117 | endif | |
591e1ffb UD |
118 | |
119 | # To find xmalloc.c and xstrdup.c | |
120 | vpath %.c ../locale/programs | |
121 | ||
b93834ef | 122 | ifeq ($(build-shared),yes) |
a9171047 UD |
123 | extra-objs += sotruss-lib.os sotruss-lib.so |
124 | install-others += $(inst_auditdir)/sotruss-lib.so | |
b0316e56 | 125 | install-bin-script += sotruss |
a9171047 | 126 | generated += sotruss |
9a484857 | 127 | libof-sotruss-lib = extramodules |
a6928d51 | 128 | $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os |
a9171047 UD |
129 | $(build-module-asneeded) |
130 | $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \ | |
131 | $(common-objpfx)libc_nonshared.a | |
132 | ||
b93834ef MF |
133 | $(objpfx)sotruss: sotruss.sh $(common-objpfx)config.make |
134 | sed -e 's%@BASH@%$(BASH)%g' \ | |
a9171047 | 135 | -e 's%@VERSION@%$(version)%g' \ |
314f6dee | 136 | -e 's%@TEXTDOMAINDIR@%$(localedir)%g' \ |
8b748aed JM |
137 | -e 's%@PREFIX@%$(prefix)%g' \ |
138 | -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ | |
139 | -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \ | |
140 | < $< > $@.new | |
a9171047 UD |
141 | chmod 555 $@.new |
142 | mv -f $@.new $@ | |
143 | $(inst_auditdir)/sotruss-lib.so: $(objpfx)sotruss-lib.so $(+force) | |
144 | $(do-install-program) | |
145 | endif | |
146 | ||
7c3018f9 ZW |
147 | tests-static-normal := tst-leaks1-static tst-array1-static tst-array5-static \ |
148 | tst-dl-iter-static \ | |
a0f83f0b | 149 | tst-tlsalign-static tst-tlsalign-extern-static \ |
8b9e9c3c | 150 | tst-linkall-static tst-env-setuid tst-env-setuid-tunables |
7c3018f9 | 151 | tests-static-internal := tst-tls1-static tst-tls2-static \ |
2000067a | 152 | tst-ptrguard1-static tst-stackguard1-static \ |
82eef55f | 153 | tst-tls1-static-non-pie tst-libc_dlvsym-static |
2000067a | 154 | |
a67029ff | 155 | CRT-tst-tls1-static-non-pie := $(csu-objpfx)crt1.o |
9d7a3741 | 156 | tst-tls1-static-non-pie-no-pie = yes |
7c3018f9 ZW |
157 | |
158 | tests := tst-tls9 tst-leaks1 \ | |
159 | tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 \ | |
160 | tst-auxv | |
161 | tests-internal := tst-tls1 tst-tls2 $(tests-static-internal) | |
162 | tests-static := $(tests-static-normal) $(tests-static-internal) | |
163 | ||
2119dcfa | 164 | ifeq (yes,$(build-shared)) |
ec1af1d8 UD |
165 | tests-static += tst-tls9-static |
166 | tst-tls9-static-ENV = \ | |
167 | LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn | |
7c3018f9 ZW |
168 | |
169 | tests += restest1 preloadtest loadfail multiload origtest resolvfail \ | |
170 | constload1 order noload filter \ | |
edcfe9ea | 171 | reldep reldep2 reldep3 reldep4 nodelete nodelete2 \ |
7c3018f9 | 172 | nodlopen nodlopen2 lateglobal initfirst global \ |
cfaf5e56 | 173 | restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \ |
7c3018f9 | 174 | tst-tls4 tst-tls5 \ |
d78efd9f | 175 | tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \ |
d26dfc60 | 176 | tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \ |
b8114edd | 177 | tst-align tst-align2 \ |
d78efd9f | 178 | tst-dlmodcount tst-dlopenrpath tst-deep1 \ |
7c3018f9 | 179 | tst-dlmopen1 tst-dlmopen3 \ |
39dd69df | 180 | unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \ |
d0503676 | 181 | tst-audit1 tst-audit2 tst-audit8 tst-audit9 \ |
7c3018f9 | 182 | tst-addr1 tst-thrlock \ |
edcfe9ea AZ |
183 | tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4 \ |
184 | tst-nodelete) \ | |
c61b4d41 | 185 | tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \ |
7c3018f9 | 186 | tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \ |
9e78f6f6 | 187 | tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload \ |
592d5c75 | 188 | tst-latepthread tst-tls-manydynamic tst-nodelete-dlclose \ |
6ca8284e AS |
189 | tst-debug1 tst-main1 tst-absolute-sym tst-absolute-zero tst-big-note \ |
190 | tst-unwind-ctor | |
aff4519d | 191 | # reldep9 |
7c3018f9 ZW |
192 | tests-internal += loadtest unload unload2 circleload1 \ |
193 | neededtest neededtest2 neededtest3 neededtest4 \ | |
194 | tst-tls3 tst-tls6 tst-tls7 tst-tls8 tst-dlmopen2 \ | |
82eef55f | 195 | tst-ptrguard1 tst-stackguard1 tst-libc_dlvsym |
95561fb9 PP |
196 | ifeq ($(build-hardcoded-path-in-tests),yes) |
197 | tests += tst-dlopen-aout | |
ce16eb52 | 198 | tst-dlopen-aout-no-pie = yes |
95561fb9 | 199 | endif |
5a384a91 | 200 | test-srcs = tst-pathopt |
33f85a3f UD |
201 | selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null) |
202 | ifneq ($(selinux-enabled),1) | |
c70ba488 | 203 | tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog |
33f85a3f | 204 | endif |
2f512715 | 205 | endif |
b8114edd | 206 | tests += $(tests-execstack-$(have-z-execstack)) |
03ac099f | 207 | ifeq ($(run-built-tests),yes) |
0b20a9e8 | 208 | tests-special += $(objpfx)tst-leaks1-mem.out \ |
920b35c9 FW |
209 | $(objpfx)tst-leaks1-static-mem.out $(objpfx)noload-mem.out \ |
210 | $(objpfx)tst-ldconfig-X.out | |
6d5c57fa | 211 | endif |
60a23f5a | 212 | tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
41e25904 | 213 | tlsmod18a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
1f20b93a AS |
214 | tlsmod17a-modules = $(addprefix tst-tlsmod17a, $(tlsmod17a-suffixes)) |
215 | tlsmod18a-modules = $(addprefix tst-tlsmod18a, $(tlsmod17a-suffixes)) | |
01b23a30 FW |
216 | one-hundred = $(foreach x,0 1 2 3 4 5 6 7 8 9, \ |
217 | 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x) | |
218 | tst-tls-many-dynamic-modules := \ | |
219 | $(foreach n,$(one-hundred),tst-tls-manydynamic$(n)mod) | |
b4bcb3ae AS |
220 | extra-test-objs += $(tlsmod17a-modules:=.os) $(tlsmod18a-modules:=.os) \ |
221 | tst-tlsalign-vars.o | |
222 | test-extras += tst-tlsmod17a tst-tlsmod18a tst-tlsalign-vars | |
a25f2023 | 223 | modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ |
2b7238dd | 224 | testobj1_1 failobj constload2 constload3 unloadmod \ |
9fb11d4c | 225 | dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \ |
11bf311e UD |
226 | nodelmod1 nodelmod2 nodelmod3 nodelmod4 \ |
227 | nodel2mod1 nodel2mod2 nodel2mod3 \ | |
228 | nodlopenmod nodlopenmod2 filtmod1 filtmod2 \ | |
ceb579a3 | 229 | reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \ |
1826d793 | 230 | reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \ |
8edd9172 | 231 | neededobj1 neededobj2 neededobj3 neededobj4 \ |
273a3cfb | 232 | neededobj5 neededobj6 firstobj globalmod1 \ |
3fac0001 | 233 | unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \ |
c47e78b1 | 234 | dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \ |
a3d731d3 | 235 | reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \ |
a41d8a74 | 236 | reldep7mod1 reldep7mod2 \ |
6d78cd00 | 237 | tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \ |
94c24227 UD |
238 | tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \ |
239 | tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \ | |
99fe3b0e | 240 | tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \ |
4c533566 | 241 | tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \ |
1f20b93a | 242 | $(tlsmod17a-modules) tst-tlsmod17b $(tlsmod18a-modules) \ |
d26dfc60 | 243 | tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \ |
6d78cd00 | 244 | circlemod1 circlemod1a circlemod2 circlemod2a \ |
cfaf5e56 | 245 | circlemod3 circlemod3a \ |
aff4519d | 246 | reldep8mod1 reldep8mod2 reldep8mod3 \ |
06f6ca90 | 247 | reldep9mod1 reldep9mod2 reldep9mod3 \ |
be184b1d UD |
248 | tst-alignmod tst-alignmod2 \ |
249 | $(modules-execstack-$(have-z-execstack)) \ | |
c0f62c56 | 250 | tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \ |
fab0abb4 | 251 | tst-dlmopen1mod tst-auditmod1 \ |
20fe49b9 | 252 | unload3mod1 unload3mod2 unload3mod3 unload3mod4 \ |
3d786f19 | 253 | unload4mod1 unload4mod2 unload4mod3 unload4mod4 \ |
bfc832cc | 254 | unload6mod1 unload6mod2 unload6mod3 \ |
1ee2ff20 | 255 | unload7mod1 unload7mod2 \ |
39dd69df | 256 | unload8mod1 unload8mod1x unload8mod2 unload8mod3 \ |
415ac3df UD |
257 | order2mod1 order2mod2 order2mod3 order2mod4 \ |
258 | tst-unique1mod1 tst-unique1mod2 \ | |
968dad0a | 259 | tst-unique2mod1 tst-unique2mod2 \ |
d0503676 | 260 | tst-auditmod9a tst-auditmod9b \ |
02d5e5d9 | 261 | $(if $(CXX),tst-unique3lib tst-unique3lib2 tst-unique4lib \ |
edcfe9ea AZ |
262 | tst-nodelete-uniquemod tst-nodelete-rtldmod \ |
263 | tst-nodelete-zmod) \ | |
968dad0a UD |
264 | tst-initordera1 tst-initorderb1 \ |
265 | tst-initordera2 tst-initorderb2 \ | |
e888bcbe | 266 | tst-initordera3 tst-initordera4 \ |
6ee65ed6 UD |
267 | tst-initorder2a tst-initorder2b tst-initorder2c \ |
268 | tst-initorder2d \ | |
e5088dc6 | 269 | tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \ |
b5fe8ec8 | 270 | tst-array5dep tst-null-argv-lib \ |
a1b85ae8 FW |
271 | tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod \ |
272 | tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \ | |
9e78f6f6 | 273 | tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \ |
57707b7f | 274 | tst-latepthreadmod $(tst-tls-many-dynamic-modules) \ |
5dba84b3 | 275 | tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \ |
0065aaaa | 276 | tst-main1mod tst-libc_dlvsym-dso tst-absolute-sym-lib \ |
6ca8284e | 277 | tst-absolute-zero-lib tst-big-note-lib tst-unwind-ctor-lib |
221e4bab JM |
278 | # Most modules build with _ISOMAC defined, but those filtered out |
279 | # depend on internal headers. | |
280 | modules-names-tests = $(filter-out ifuncmod% tst-libc_dlvsym-dso tst-tlsmod%,\ | |
281 | $(modules-names)) | |
0065aaaa | 282 | |
61655555 L |
283 | ifeq (yes,$(have-mtls-dialect-gnu2)) |
284 | tests += tst-gnu2-tls1 | |
285 | modules-names += tst-gnu2-tls1mod | |
286 | $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so | |
287 | tst-gnu2-tls1mod.so-no-z-defs = yes | |
288 | CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2 | |
289 | endif | |
83569fb8 L |
290 | ifeq (yes,$(have-protected-data)) |
291 | modules-names += tst-protected1moda tst-protected1modb | |
292 | tests += tst-protected1a tst-protected1b | |
293 | $(objpfx)tst-protected1a: $(addprefix $(objpfx),tst-protected1moda.so tst-protected1modb.so) | |
294 | $(objpfx)tst-protected1b: $(addprefix $(objpfx),tst-protected1modb.so tst-protected1moda.so) | |
295 | tst-protected1modb.so-no-z-defs = yes | |
0092d4da RM |
296 | # These tests fail with GCC versions prior to 5.1 and with some versions |
297 | # of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709 | |
298 | # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details. | |
299 | # Perhaps in future we can make these XFAILs conditional on some detection | |
300 | # of compiler/linker behavior/version. | |
301 | test-xfail-tst-protected1a = yes | |
302 | test-xfail-tst-protected1b = yes | |
83569fb8 | 303 | endif |
f17ed1a9 UD |
304 | ifeq (yesyes,$(have-fpie)$(build-shared)) |
305 | modules-names += tst-piemod1 | |
798212a0 PP |
306 | tests += tst-pie1 tst-pie2 |
307 | tests-pie += tst-pie1 tst-pie2 | |
3093fd5e | 308 | ifeq (yes,$(have-protected-data)) |
ef4ad06f L |
309 | tests += vismain |
310 | tests-pie += vismain | |
36975e8e | 311 | CFLAGS-vismain.c += $(PIE-ccflag) |
f17ed1a9 | 312 | endif |
3093fd5e | 313 | endif |
2abf9ff1 | 314 | modules-execstack-yes = tst-execstack-mod |
376e973a | 315 | extra-test-objs += $(addsuffix .os,$(strip $(modules-names))) |
dc18d4d8 | 316 | |
aed48a2a RM |
317 | # filtmod1.so has a special rule |
318 | modules-names-nobuild := filtmod1 | |
319 | ||
7c3018f9 ZW |
320 | tests += $(tests-static) |
321 | ||
5d5732b0 | 322 | ifneq (no,$(multi-arch)) |
7c3018f9 | 323 | tests-ifuncstatic := ifuncmain1static ifuncmain1picstatic \ |
2f083d75 | 324 | ifuncmain2static ifuncmain2picstatic \ |
3c30afc8 L |
325 | ifuncmain4static ifuncmain4picstatic \ |
326 | ifuncmain5static ifuncmain5picstatic \ | |
327 | ifuncmain7static ifuncmain7picstatic | |
7c3018f9 ZW |
328 | tests-static += $(tests-ifuncstatic) |
329 | tests-internal += $(tests-ifuncstatic) | |
2f083d75 | 330 | ifeq (yes,$(build-shared)) |
7c3018f9 ZW |
331 | tests-internal += \ |
332 | ifuncmain1 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \ | |
2f083d75 | 333 | ifuncmain1staticpic \ |
3c30afc8 L |
334 | ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \ |
335 | ifuncmain5 ifuncmain5pic ifuncmain5staticpic \ | |
336 | ifuncmain7 ifuncmain7pic | |
1f20b93a AS |
337 | ifunc-test-modules = ifuncdep1 ifuncdep1pic ifuncdep2 ifuncdep2pic \ |
338 | ifuncdep5 ifuncdep5pic | |
339 | extra-test-objs += $(ifunc-test-modules:=.o) | |
7c3018f9 | 340 | test-internal-extras += $(ifunc-test-modules) |
2f083d75 | 341 | ifeq (yes,$(have-fpie)) |
1f20b93a AS |
342 | ifunc-pie-tests = ifuncmain1pie ifuncmain1vispie ifuncmain1staticpie \ |
343 | ifuncmain5pie ifuncmain6pie ifuncmain7pie | |
b5c45e83 AZ |
344 | ifeq (yes,$(have-textrel_ifunc)) |
345 | ifunc-pie-tests += tst-ifunc-textrel | |
346 | endif | |
7c3018f9 | 347 | tests-internal += $(ifunc-pie-tests) |
da62f81b | 348 | tests-pie += $(ifunc-pie-tests) |
2f083d75 | 349 | endif |
3c30afc8 | 350 | modules-names += ifuncmod1 ifuncmod3 ifuncmod5 ifuncmod6 |
2f083d75 L |
351 | endif |
352 | endif | |
353 | ||
f214606a JM |
354 | ifeq (yes,$(build-shared)) |
355 | ifeq ($(run-built-tests),yes) | |
356 | tests-special += $(objpfx)tst-pathopt.out $(objpfx)tst-rtld-load-self.out | |
357 | endif | |
358 | tests-special += $(objpfx)check-textrel.out $(objpfx)check-execstack.out \ | |
67c05796 | 359 | $(objpfx)check-localplt.out $(objpfx)check-initfini.out |
f214606a | 360 | endif |
aed48a2a | 361 | |
f214606a JM |
362 | ifeq ($(run-built-tests),yes) |
363 | tests-special += $(objpfx)order-cmp.out $(objpfx)tst-array1-cmp.out \ | |
364 | $(objpfx)tst-array1-static-cmp.out \ | |
365 | $(objpfx)tst-array2-cmp.out $(objpfx)tst-array3-cmp.out \ | |
366 | $(objpfx)tst-array4-cmp.out $(objpfx)tst-array5-cmp.out \ | |
367 | $(objpfx)tst-array5-static-cmp.out $(objpfx)order2-cmp.out \ | |
368 | $(objpfx)tst-initorder-cmp.out \ | |
369 | $(objpfx)tst-initorder2-cmp.out $(objpfx)tst-unused-dep.out \ | |
370 | $(objpfx)tst-unused-dep-cmp.out | |
371 | endif | |
d66e34cd | 372 | |
1b6dd3f1 | 373 | check-abi: $(objpfx)check-abi-ld.out |
f214606a | 374 | tests-special += $(objpfx)check-abi-ld.out |
fd54683c | 375 | update-abi: update-abi-ld |
c100dca3 | 376 | update-all-abi: update-all-abi-ld |
fd54683c | 377 | |
89569c8b L |
378 | ifeq ($(have-glob-dat-reloc),yes) |
379 | tests += tst-prelink | |
e13daad7 L |
380 | # Don't compile tst-prelink.c with PIE for GLOB_DAT relocation. |
381 | CFLAGS-tst-prelink.c += -fno-pie | |
ce16eb52 | 382 | tst-prelink-no-pie = yes |
89569c8b L |
383 | ifeq ($(run-built-tests),yes) |
384 | tests-special += $(objpfx)tst-prelink-cmp.out | |
385 | endif | |
386 | endif | |
387 | ||
d61ef735 CD |
388 | # The test requires shared _and_ PIE because the executable |
389 | # unit test driver must be able to link with the shared object | |
390 | # that is going to eventually go into an installed DSO. | |
391 | ifeq (yesyes,$(have-fpie)$(build-shared)) | |
7c3018f9 | 392 | tests-internal += tst-_dl_addr_inside_object |
d61ef735 CD |
393 | tests-pie += tst-_dl_addr_inside_object |
394 | $(objpfx)tst-_dl_addr_inside_object: $(objpfx)dl-addr-obj.os | |
395 | CFLAGS-tst-_dl_addr_inside_object.c += $(PIE-ccflag) | |
396 | endif | |
397 | ||
e69d994a ZW |
398 | # We can only test static libcrypt use if libcrypt has been built, |
399 | # and either NSS crypto is not in use, or static NSS libraries are | |
400 | # available. | |
401 | ifeq ($(build-crypt),no) | |
402 | CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=0 | |
403 | else | |
404 | ifeq ($(nss-crypt),no) | |
405 | CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=1 | |
406 | else | |
407 | ifeq ($(static-nss-crypt),no) | |
408 | CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=0 | |
409 | else | |
36975e8e | 410 | CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=1 |
e69d994a ZW |
411 | endif |
412 | endif | |
84aa7516 CD |
413 | endif |
414 | ||
f214606a JM |
415 | include ../Rules |
416 | ||
1ef32c3d | 417 | ifeq (yes,$(build-shared)) |
a89d30d4 RM |
418 | # Make sure these things are built in the `make lib' pass so they can be used |
419 | # to run programs during the `make others' pass. | |
420 | lib-noranlib: $(objpfx)$(rtld-installed-name) \ | |
421 | $(addprefix $(objpfx),$(extra-objs)) | |
422 | endif | |
423 | ||
db2286f6 | 424 | # Command to link into a larger single relocatable object. |
b350afab | 425 | reloc-link = $(LINK.o) -nostdlib -nostartfiles -r |
db2286f6 | 426 | |
a6928d51 RM |
427 | $(objpfx)sotruss-lib.so: $(shlib-lds) |
428 | ||
b79f74cd | 429 | $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os) |
ce460d04 | 430 | $(reloc-link) -o $@ $^ |
db2286f6 | 431 | |
86d2c878 | 432 | # Link together the dynamic linker into a single relocatable object. |
ce460d04 RM |
433 | # First we do a link against libc_pic.a just to get a link map, |
434 | # and discard the object produced by that link. From the link map | |
435 | # we can glean all the libc modules that need to go into the dynamic | |
436 | # linker. Then we do a recursive make that goes into all the subdirs | |
437 | # those modules come from and builds special rtld-foo.os versions that | |
438 | # are compiled with special flags, and puts these modules into rtld-libc.a | |
439 | # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a. | |
440 | ||
bc174f20 NA |
441 | # If the compiler can do SSP, build the mapfile with dummy __stack_chk_fail |
442 | # and __stack_chk_fail_local symbols defined, to prevent the real things | |
443 | # being dragged into rtld even though rtld is never built with stack- | |
444 | # protection. | |
445 | ||
446 | ifeq ($(have-ssp),yes) | |
447 | dummy-stack-chk-fail := -Wl,--defsym='__stack_chk_fail=0' \ | |
448 | -Wl,--defsym='__stack_chk_fail_local=0' | |
449 | else | |
450 | dummy-stack-chk-fail := | |
451 | endif | |
452 | ||
ce460d04 | 453 | $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a |
240e87c2 | 454 | @-rm -f $@T |
bc174f20 NA |
455 | $(reloc-link) -o $@.o $(dummy-stack-chk-fail) \ |
456 | '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T | |
ce460d04 | 457 | rm -f $@.o |
240e87c2 | 458 | mv -f $@T $@ |
ce460d04 RM |
459 | |
460 | $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile | |
b61c8aba | 461 | LC_ALL=C \ |
6461e577 RM |
462 | sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \ |
463 | $< | \ | |
ce460d04 RM |
464 | while read lib file; do \ |
465 | case $$lib in \ | |
466 | libc_pic.a) \ | |
b61c8aba | 467 | LC_ALL=C fgrep -l /$$file \ |
ce460d04 | 468 | $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \ |
b61c8aba | 469 | LC_ALL=C \ |
ce460d04 RM |
470 | sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\ |
471 | ;; \ | |
472 | */*.a) \ | |
473 | echo rtld-$${lib%%/*} += $$file ;; \ | |
474 | *) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \ | |
475 | esac; \ | |
476 | done > $@T | |
b61c8aba UD |
477 | echo rtld-subdirs = `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \ |
478 | | LC_ALL=C sort -u` >> $@T | |
ce460d04 RM |
479 | mv -f $@T $@ |
480 | ||
481 | $(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE | |
482 | $(MAKE) -f $< -f rtld-Rules | |
483 | ||
ce460d04 | 484 | $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a |
b350afab | 485 | $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' \ |
5896ffa8 UD |
486 | -Wl,-Map,$@.map |
487 | ||
488 | generated += librtld.map librtld.mk rtld-libc.a librtld.os.map | |
d66e34cd | 489 | |
4df8c11d UD |
490 | z-now-yes = -Wl,-z,now |
491 | ||
32e6df36 | 492 | $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map) |
f4a29fba RM |
493 | # Link into a temporary file so that we don't touch $@ at all |
494 | # if the sanity check below fails. | |
495 | $(LINK.o) -nostdlib -nostartfiles -shared -o $@.new \ | |
4df8c11d | 496 | $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \ |
32e6df36 | 497 | $(filter-out $(map-file),$^) $(load-map-file) \ |
4e34ac6a RM |
498 | -Wl,-soname=$(rtld-installed-name) \ |
499 | -Wl,-defsym=_begin=0 | |
04f5a636 | 500 | $(call after-link,$@.new) |
f4a29fba | 501 | $(READELF) -s $@.new \ |
0a80eb74 | 502 | | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' |
f4a29fba | 503 | mv -f $@.new $@ |
266180eb | 504 | |
ac63a078 | 505 | ifeq (yes,$(build-shared)) |
d330b980 | 506 | # interp.c exists just to get the runtime linker path into libc.so. |
ac63a078 DL |
507 | $(objpfx)interp.os: $(common-objpfx)runtime-linker.h |
508 | endif | |
c7562c74 | 509 | |
1ef32c3d | 510 | ifneq (ld.so,$(rtld-installed-name)) |
afd4eb37 | 511 | # Make sure ld.so.1 exists in the build directory so we can link |
852fc4b9 RM |
512 | # against it. |
513 | $(objpfx)$(rtld-installed-name): $(objpfx)ld.so | |
85ee9a0d | 514 | $(make-link) |
da2d1bc5 | 515 | generated += $(rtld-installed-name) |
852fc4b9 RM |
516 | endif |
517 | ||
fd26970f UD |
518 | # Build a file mentioning all trustworthy directories to look for shared |
519 | # libraries when using LD_LIBRARY_PATH in a setuid program. The user can | |
520 | # add directories to the list by defining $(user-defined-trusted-dirs) | |
521 | # before starting make. | |
6598ac30 UD |
522 | $(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @: |
523 | $(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig | |
1ef32c3d | 524 | $(make-target-directory) |
ab7eb292 UD |
525 | echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \ |
526 | | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T}; | |
ce460d04 | 527 | echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T} |
6598ac30 UD |
528 | $(move-if-change) ${@:st=T} ${@:st=h} |
529 | touch $@ | |
36975e8e | 530 | CPPFLAGS-dl-load.c += -I$(objpfx). -I$(csu-objpfx). |
86d2c878 | 531 | |
9f2a9248 | 532 | ifeq (yes,$(build-shared)) |
73237de3 | 533 | $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force) |
460adbb8 | 534 | $(make-target-directory) |
925e31d9 | 535 | $(do-install-program) |
1ef32c3d | 536 | |
aaa8cb4b | 537 | $(inst_rtlddir)/$(rtld-installed-name): \ |
460adbb8 UD |
538 | $(inst_slibdir)/$(rtld-version-installed-name) \ |
539 | $(inst_slibdir)/libc-$(version).so | |
aaa8cb4b | 540 | $(make-target-directory) |
925e31d9 | 541 | $(make-shlib-link) |
b122c703 | 542 | |
5148d49f UD |
543 | # Special target called by parent to install just the dynamic linker. |
544 | .PHONY: ldso_install | |
aaa8cb4b | 545 | ldso_install: $(inst_rtlddir)/$(rtld-installed-name) |
9f2a9248 | 546 | endif |
5148d49f | 547 | |
cb343854 | 548 | |
43ca83ec MF |
549 | ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \ |
550 | -e 's%@VERSION@%$(version)%g' \ | |
551 | -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ | |
552 | -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \ | |
553 | -e 's%@BASH@%$(BASH)%g' \ | |
314f6dee | 554 | -e 's%@TEXTDOMAINDIR@%$(localedir)%g' |
cb343854 UD |
555 | |
556 | ifeq ($(ldd-rewrite-script),no) | |
557 | define gen-ldd | |
43ca83ec | 558 | LC_ALL=C sed $(ldd-rewrite) < $< > $@.new |
cb343854 | 559 | endef |
84384f5b | 560 | else |
cb343854 | 561 | define gen-ldd |
43ca83ec | 562 | LC_ALL=C sed $(ldd-rewrite) < $< \ |
52d4fef8 | 563 | | LC_ALL=C sed -f $(patsubst $(..)/%,/%,$(..)$(ldd-rewrite-script)) > $@.new |
cb343854 UD |
564 | endef |
565 | endif | |
566 | ||
926e512f | 567 | $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \ |
ee74a442 | 568 | $(common-objpfx)config.make |
cb343854 | 569 | $(gen-ldd) |
84384f5b UD |
570 | chmod 555 $@.new |
571 | mv -f $@.new $@ | |
cb343854 | 572 | |
aaff4ba9 | 573 | $(objpfx)sprof: $(libdl) |
94e365c6 | 574 | |
95f5a9a8 JM |
575 | $(objpfx)sln: $(sln-modules:%=$(objpfx)%.o) |
576 | ||
591e1ffb | 577 | $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) |
11988f8f | 578 | |
8ca91b36 | 579 | SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' |
36975e8e | 580 | CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ |
4f41c682 | 581 | -D'SLIBDIR="$(slibdir)"' |
9cd47470 | 582 | libof-ldconfig = ldconfig |
36975e8e L |
583 | CFLAGS-dl-cache.c += $(SYSCONF-FLAGS) |
584 | CFLAGS-cache.c += $(SYSCONF-FLAGS) | |
585 | CFLAGS-rtld.c += $(SYSCONF-FLAGS) | |
591e1ffb | 586 | |
9cd47470 SP |
587 | cpp-srcs-left := $(all-rtld-routines:=.os) |
588 | lib := rtld | |
2bfdaedd | 589 | include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left)) |
9cd47470 | 590 | |
9b014809 UD |
591 | test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) |
592 | generated += $(addsuffix .so,$(strip $(modules-names))) | |
482eec0d | 593 | |
aaff4ba9 UD |
594 | $(objpfx)testobj1.so: $(libdl) |
595 | $(objpfx)testobj1_1.so: $(objpfx)testobj1.so $(libdl) | |
596 | $(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl) | |
597 | $(objpfx)testobj3.so: $(libdl) | |
598 | $(objpfx)testobj4.so: $(libdl) | |
599 | $(objpfx)testobj5.so: $(libdl) | |
e30f2b98 | 600 | $(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so $(libdl) |
e18db2b0 | 601 | $(objpfx)failobj.so: $(objpfx)testobj6.so |
84ddc586 UD |
602 | $(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so |
603 | $(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so | |
604 | $(objpfx)dep4.so: $(objpfx)dep3.so | |
2cb8cefb | 605 | $(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so |
917fd061 | 606 | $(objpfx)nextmod1.so: $(libdl) |
ceb579a3 UD |
607 | $(objpfx)neededobj1.so: $(libdl) |
608 | $(objpfx)neededobj2.so: $(objpfx)neededobj1.so $(libdl) | |
609 | $(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so $(libdl) | |
8edd9172 UD |
610 | $(objpfx)neededobj4.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ |
611 | $(objpfx)neededobj3.so $(libdl) | |
c77a4478 | 612 | $(objpfx)neededobj6.so: $(objpfx)neededobj5.so |
f6de2239 | 613 | $(objpfx)unload2mod.so: $(objpfx)unload2dep.so |
d785c366 | 614 | $(objpfx)ltglobmod2.so: $(libdl) |
b71e7ce8 | 615 | $(objpfx)firstobj.so: $(shared-thread-library) |
273a3cfb | 616 | $(objpfx)globalmod1.so: $(libdl) |
1826d793 UD |
617 | $(objpfx)reldep4mod1.so: $(objpfx)reldep4mod3.so |
618 | $(objpfx)reldep4mod2.so: $(objpfx)reldep4mod4.so | |
3fac0001 UD |
619 | $(objpfx)dblloadmod1.so: $(objpfx)dblloadmod3.so |
620 | $(objpfx)dblloadmod2.so: $(objpfx)dblloadmod3.so | |
c4bb124a UD |
621 | $(objpfx)reldepmod5.so: $(objpfx)reldepmod2.so |
622 | $(objpfx)reldepmod6.so: $(objpfx)reldepmod2.so | |
c47e78b1 UD |
623 | $(objpfx)reldep6mod1.so: $(objpfx)reldep6mod0.so |
624 | $(objpfx)reldep6mod2.so: $(objpfx)reldep6mod1.so | |
625 | $(objpfx)reldep6mod3.so: $(objpfx)reldep6mod2.so | |
626 | $(objpfx)reldep6mod4.so: $(objpfx)reldep6mod1.so | |
fc093be1 | 627 | $(objpfx)tst-tlsmod3.so: $(objpfx)tst-tlsmod2.so |
94c24227 UD |
628 | $(objpfx)tst-tlsmod8.so: $(objpfx)tst-tlsmod7.so |
629 | $(objpfx)tst-tlsmod10.so: $(objpfx)tst-tlsmod9.so | |
630 | $(objpfx)tst-tlsmod12.so: $(objpfx)tst-tlsmod11.so | |
541765b6 | 631 | $(objpfx)tst-tlsmod13a.so: $(objpfx)tst-tlsmod13.so |
aff4519d UD |
632 | # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED |
633 | $(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so | |
634 | $(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so | |
d26dfc60 MG |
635 | $(objpfx)tst-tls19mod1.so: $(objpfx)tst-tls19mod2.so $(objpfx)tst-tls19mod3.so |
636 | $(objpfx)tst-tls19mod3.so: $(objpfx)ld.so | |
556224ab | 637 | $(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so |
aff4519d UD |
638 | $(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so |
639 | $(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so | |
640 | $(objpfx)reldep9mod3.so: $(objpfx)reldep9mod1.so $(objpfx)reldep9mod2.so | |
fab0abb4 UD |
641 | $(objpfx)unload3mod1.so: $(objpfx)unload3mod3.so |
642 | $(objpfx)unload3mod2.so: $(objpfx)unload3mod3.so | |
643 | $(objpfx)unload3mod3.so: $(objpfx)unload3mod4.so | |
20fe49b9 UD |
644 | $(objpfx)unload4mod1.so: $(objpfx)unload4mod2.so $(objpfx)unload4mod3.so |
645 | $(objpfx)unload4mod2.so: $(objpfx)unload4mod4.so $(objpfx)unload4mod3.so | |
bfc832cc UD |
646 | $(objpfx)unload6mod1.so: $(libdl) |
647 | $(objpfx)unload6mod2.so: $(libdl) | |
648 | $(objpfx)unload6mod3.so: $(libdl) | |
1ee2ff20 UD |
649 | $(objpfx)unload7mod1.so: $(libdl) |
650 | $(objpfx)unload7mod2.so: $(objpfx)unload7mod1.so | |
39dd69df AS |
651 | $(objpfx)unload8mod1.so: $(objpfx)unload8mod2.so |
652 | $(objpfx)unload8mod2.so: $(objpfx)unload8mod3.so | |
653 | $(objpfx)unload8mod3.so: $(libdl) | |
968dad0a UD |
654 | $(objpfx)tst-initordera2.so: $(objpfx)tst-initordera1.so |
655 | $(objpfx)tst-initorderb2.so: $(objpfx)tst-initorderb1.so $(objpfx)tst-initordera2.so | |
656 | $(objpfx)tst-initordera3.so: $(objpfx)tst-initorderb2.so $(objpfx)tst-initorderb1.so | |
657 | $(objpfx)tst-initordera4.so: $(objpfx)tst-initordera3.so | |
658 | $(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so $(objpfx)tst-initorderb2.so | |
b9375348 | 659 | $(objpfx)tst-null-argv: $(objpfx)tst-null-argv-lib.so |
b5fe8ec8 | 660 | $(objpfx)tst-tlsalign: $(objpfx)tst-tlsalign-lib.so |
b632bdd3 SP |
661 | $(objpfx)tst-nodelete-opened.out: $(objpfx)tst-nodelete-opened-lib.so |
662 | $(objpfx)tst-nodelete-opened: $(libdl) | |
ead3cea7 | 663 | $(objpfx)tst-noload: $(libdl) |
b5fe8ec8 | 664 | |
1a1a6bde RM |
665 | $(objpfx)tst-tlsalign-extern: $(objpfx)tst-tlsalign-vars.o |
666 | $(objpfx)tst-tlsalign-extern-static: $(objpfx)tst-tlsalign-vars.o | |
667 | ||
b9375348 | 668 | tst-null-argv-ENV = LD_DEBUG=all LD_DEBUG_OUTPUT=$(objpfx)tst-null-argv.debug.out |
d4c2917f AM |
669 | LDFLAGS-nodel2mod3.so = $(no-as-needed) |
670 | LDFLAGS-reldepmod5.so = $(no-as-needed) | |
671 | LDFLAGS-reldep6mod1.so = $(no-as-needed) | |
672 | LDFLAGS-reldep6mod4.so = $(no-as-needed) | |
673 | LDFLAGS-reldep8mod3.so = $(no-as-needed) | |
674 | LDFLAGS-unload4mod1.so = $(no-as-needed) | |
675 | LDFLAGS-unload4mod2.so = $(no-as-needed) | |
676 | LDFLAGS-tst-initorder = $(no-as-needed) | |
677 | LDFLAGS-tst-initordera2.so = $(no-as-needed) | |
678 | LDFLAGS-tst-initordera3.so = $(no-as-needed) | |
679 | LDFLAGS-tst-initordera4.so = $(no-as-needed) | |
680 | LDFLAGS-tst-initorderb2.so = $(no-as-needed) | |
0ded08a5 AZ |
681 | LDFLAGS-tst-tlsmod5.so = -nostdlib $(no-as-needed) |
682 | LDFLAGS-tst-tlsmod6.so = -nostdlib $(no-as-needed) | |
6ef518c3 | 683 | |
1a379ea0 UD |
684 | testobj1.so-no-z-defs = yes |
685 | testobj3.so-no-z-defs = yes | |
686 | testobj4.so-no-z-defs = yes | |
687 | testobj5.so-no-z-defs = yes | |
688 | testobj6.so-no-z-defs = yes | |
689 | failobj.so-no-z-defs = yes | |
690 | constload2.so-no-z-defs = yes | |
691 | constload3.so-no-z-defs = yes | |
692 | nodelmod1.so-no-z-defs = yes | |
693 | nodelmod2.so-no-z-defs = yes | |
694 | nodelmod4.so-no-z-defs = yes | |
695 | nodel2mod2.so-no-z-defs = yes | |
696 | reldepmod2.so-no-z-defs = yes | |
697 | reldepmod3.so-no-z-defs = yes | |
698 | reldepmod4.so-no-z-defs = yes | |
699 | reldep4mod4.so-no-z-defs = yes | |
700 | reldep4mod2.so-no-z-defs = yes | |
701 | ltglobmod2.so-no-z-defs = yes | |
702 | dblloadmod3.so-no-z-defs = yes | |
703 | tst-tlsmod1.so-no-z-defs = yes | |
704 | tst-tlsmod2.so-no-z-defs = yes | |
705 | tst-tlsmod3.so-no-z-defs = yes | |
706 | tst-tlsmod4.so-no-z-defs = yes | |
707 | tst-tlsmod7.so-no-z-defs = yes | |
708 | tst-tlsmod8.so-no-z-defs = yes | |
709 | tst-tlsmod9.so-no-z-defs = yes | |
710 | tst-tlsmod10.so-no-z-defs = yes | |
711 | tst-tlsmod12.so-no-z-defs = yes | |
99fe3b0e UD |
712 | tst-tlsmod14a.so-no-z-defs = yes |
713 | tst-tlsmod14b.so-no-z-defs = yes | |
167d5acc | 714 | tst-tlsmod15a.so-no-z-defs = yes |
4c533566 | 715 | tst-tlsmod16b.so-no-z-defs = yes |
1a379ea0 UD |
716 | circlemod2.so-no-z-defs = yes |
717 | circlemod3.so-no-z-defs = yes | |
718 | circlemod3a.so-no-z-defs = yes | |
719 | reldep8mod2.so-no-z-defs = yes | |
720 | reldep9mod1.so-no-z-defs = yes | |
fab0abb4 | 721 | unload3mod4.so-no-z-defs = yes |
20fe49b9 | 722 | unload4mod1.so-no-z-defs = yes |
2f083d75 | 723 | ifuncmod1.so-no-z-defs = yes |
3c30afc8 L |
724 | ifuncmod5.so-no-z-defs = yes |
725 | ifuncmod6.so-no-z-defs = yes | |
d0503676 CD |
726 | tst-auditmod9a.so-no-z-defs = yes |
727 | tst-auditmod9b.so-no-z-defs = yes | |
02d5e5d9 PK |
728 | tst-nodelete-uniquemod.so-no-z-defs = yes |
729 | tst-nodelete-rtldmod.so-no-z-defs = yes | |
730 | tst-nodelete-zmod.so-no-z-defs = yes | |
f25238ff | 731 | tst-nodelete2mod.so-no-z-defs = yes |
a334319f | 732 | |
5181d776 RM |
733 | ifeq ($(build-shared),yes) |
734 | # Build all the modules even when not actually running test programs. | |
735 | tests: $(test-modules) | |
736 | endif | |
737 | ||
aaff4ba9 | 738 | $(objpfx)loadtest: $(libdl) |
482eec0d UD |
739 | LDFLAGS-loadtest = -rdynamic |
740 | ||
741 | $(objpfx)loadtest.out: $(test-modules) | |
6bd06384 | 742 | |
ceb579a3 | 743 | $(objpfx)neededtest: $(libdl) |
ceb579a3 | 744 | $(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ |
8edd9172 | 745 | $(objpfx)neededobj3.so |
ceb579a3 | 746 | |
9807e540 UD |
747 | $(objpfx)neededtest2: $(libdl) |
748 | $(objpfx)neededtest2.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ | |
8edd9172 UD |
749 | $(objpfx)neededobj3.so |
750 | ||
751 | $(objpfx)neededtest3: $(libdl) | |
752 | $(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ | |
753 | $(objpfx)neededobj3.so $(objpfx)neededobj4.so | |
9807e540 | 754 | |
c77a4478 UD |
755 | $(objpfx)neededtest4: $(libdl) $(objpfx)neededobj1.so |
756 | $(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so | |
757 | ||
aaff4ba9 | 758 | $(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so $(libdl) |
e18db2b0 | 759 | LDFLAGS-restest1 = -rdynamic |
6bd06384 | 760 | |
2373b30e UD |
761 | $(objpfx)restest2: $(libdl) |
762 | LDFLAGS-restest2 = -rdynamic | |
763 | ||
6bd06384 | 764 | $(objpfx)restest1.out: $(test-modules) |
3d91edb2 | 765 | |
e18db2b0 | 766 | preloadtest-preloads = testobj1 testobj2 testobj3 testobj4 testobj5 |
10584d2e | 767 | $(objpfx)preloadtest: $(objpfx)testobj6.so |
10584d2e | 768 | LDFLAGS-preloadtest = -rdynamic |
e18db2b0 UD |
769 | $(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so) |
770 | preloadtest-ENV = \ | |
771 | LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so))) | |
1e262312 | 772 | |
aaff4ba9 | 773 | $(objpfx)loadfail: $(libdl) |
1e262312 UD |
774 | LDFLAGS-loadfail = -rdynamic |
775 | ||
61e0617a UD |
776 | $(objpfx)loadfail.out: $(objpfx)failobj.so |
777 | ||
778 | $(objpfx)multiload: $(libdl) | |
779 | LDFLAGS-multiload = -rdynamic | |
36975e8e | 780 | CFLAGS-multiload.c += -DOBJDIR=\"$(elf-objpfx)\" |
61e0617a UD |
781 | |
782 | $(objpfx)multiload.out: $(objpfx)testobj1.so | |
dc5efe83 UD |
783 | |
784 | $(objpfx)origtest: $(libdl) | |
394679eb | 785 | LDFLAGS-origtest = -rdynamic |
dc5efe83 | 786 | $(objpfx)origtest.out: $(objpfx)testobj1.so |
ff5fad16 UD |
787 | |
788 | ifeq ($(have-thread-library),yes) | |
789 | $(objpfx)resolvfail: $(libdl) $(shared-thread-library) | |
790 | else | |
791 | $(objpfx)resolvfail: $(libdl) | |
792 | endif | |
19cf43be UD |
793 | |
794 | $(objpfx)constload1: $(libdl) | |
795 | $(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so | |
84ddc586 | 796 | |
6d78cd00 UD |
797 | $(objpfx)circleload1: $(libdl) |
798 | $(objpfx)circleload1.out: $(objpfx)circlemod1.so \ | |
799 | $(objpfx)circlemod1a.so | |
800 | ||
801 | $(objpfx)circlemod1.so: $(objpfx)circlemod2.so | |
802 | $(objpfx)circlemod2.so: $(objpfx)circlemod3.so | |
803 | $(objpfx)circlemod1a.so: $(objpfx)circlemod2a.so | |
804 | $(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so | |
805 | ||
84ddc586 UD |
806 | $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so) |
807 | ||
6e89caf1 | 808 | $(objpfx)order-cmp.out: $(objpfx)order.out |
f0881698 JM |
809 | (echo "0123456789" | cmp $< -) > $@; \ |
810 | $(evaluate-test) | |
c1025c19 UD |
811 | |
812 | $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so) | |
813 | $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so) | |
814 | vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so) | |
5e61ef88 | 815 | |
79520f4b | 816 | $(objpfx)noload: $(objpfx)testobj1.so $(libdl) |
d4c2917f | 817 | LDFLAGS-noload = -rdynamic $(no-as-needed) |
5e61ef88 | 818 | $(objpfx)noload.out: $(objpfx)testobj5.so |
0fb7851f | 819 | |
0b20a9e8 | 820 | $(objpfx)noload-mem.out: $(objpfx)noload.out |
f0881698 JM |
821 | $(common-objpfx)malloc/mtrace $(objpfx)noload.mtrace > $@; \ |
822 | $(evaluate-test) | |
4bff6e01 AS |
823 | noload-ENV = MALLOC_TRACE=$(objpfx)noload.mtrace |
824 | ||
ad7534c8 | 825 | LDFLAGS-nodelete = -rdynamic |
0fb7851f | 826 | LDFLAGS-nodelmod1.so = -Wl,--enable-new-dtags,-z,nodelete |
2cb8cefb | 827 | LDFLAGS-nodelmod4.so = -Wl,--enable-new-dtags,-z,nodelete |
0fb7851f | 828 | $(objpfx)nodelete: $(libdl) |
2cb8cefb UD |
829 | $(objpfx)nodelete.out: $(objpfx)nodelmod1.so $(objpfx)nodelmod2.so \ |
830 | $(objpfx)nodelmod3.so | |
2f54c82d UD |
831 | |
832 | LDFLAGS-nodlopenmod.so = -Wl,--enable-new-dtags,-z,nodlopen | |
833 | $(objpfx)nodlopen: $(libdl) | |
834 | $(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so | |
fcacb36a | 835 | |
87837aac UD |
836 | $(objpfx)nodlopenmod2.so: $(objpfx)nodlopenmod.so |
837 | $(objpfx)nodlopen2: $(libdl) | |
838 | $(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so | |
839 | ||
137bca87 UD |
840 | $(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so |
841 | $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \ | |
842 | -L$(subst :, -L,$(rpath-link)) \ | |
843 | -Wl,-rpath-link=$(rpath-link) \ | |
844 | $< -Wl,-F,$(objpfx)filtmod2.so | |
fcacb36a | 845 | $(objpfx)filter: $(objpfx)filtmod1.so |
2b7238dd | 846 | |
7cbb738d | 847 | # This does not link against libc. |
36975e8e | 848 | CFLAGS-filtmod1.c += $(no-stack-protector) |
7cbb738d | 849 | |
2b7238dd UD |
850 | $(objpfx)unload: $(libdl) |
851 | $(objpfx)unload.out: $(objpfx)unloadmod.so | |
852 | ||
853 | $(objpfx)reldep: $(libdl) | |
854 | $(objpfx)reldep.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod2.so | |
855 | ||
856 | $(objpfx)reldep2: $(libdl) | |
857 | $(objpfx)reldep2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so | |
858 | ||
859 | $(objpfx)reldep3: $(libdl) | |
860 | $(objpfx)reldep3.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so | |
917fd061 | 861 | |
1826d793 UD |
862 | $(objpfx)reldep4: $(libdl) |
863 | $(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so | |
864 | ||
917fd061 | 865 | $(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so $(libdl) |
d4c2917f | 866 | LDFLAGS-next = $(no-as-needed) |
f6de2239 UD |
867 | |
868 | $(objpfx)unload2: $(libdl) | |
869 | $(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so | |
d785c366 UD |
870 | |
871 | $(objpfx)lateglobal: $(libdl) | |
872 | $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so | |
5a384a91 UD |
873 | |
874 | $(objpfx)tst-pathopt: $(libdl) | |
875 | $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \ | |
876 | $(objpfx)pathoptobj.so | |
8540f6d2 | 877 | $(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' \ |
d5afb385 | 878 | '$(run-program-env)' > $@; \ |
f0881698 | 879 | $(evaluate-test) |
b71e7ce8 | 880 | |
f3fd569c | 881 | $(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so |
f0881698 JM |
882 | $(SHELL) $^ '$(test-wrapper)' '$(test-wrapper-env)' > $@; \ |
883 | $(evaluate-test) | |
f3fd569c | 884 | |
b71e7ce8 UD |
885 | $(objpfx)initfirst: $(libdl) |
886 | $(objpfx)initfirst.out: $(objpfx)firstobj.so | |
273a3cfb UD |
887 | |
888 | $(objpfx)global: $(objpfx)globalmod1.so | |
889 | $(objpfx)global.out: $(objpfx)reldepmod1.so | |
3fac0001 UD |
890 | |
891 | $(objpfx)dblload: $(libdl) | |
892 | $(objpfx)dblload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so | |
893 | ||
894 | $(objpfx)dblunload: $(libdl) | |
895 | $(objpfx)dblunload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so | |
c4bb124a UD |
896 | |
897 | $(objpfx)reldep5: $(libdl) | |
ac2d6e9b | 898 | $(objpfx)reldep5.out: $(objpfx)reldepmod5.so $(objpfx)reldepmod6.so |
c47e78b1 UD |
899 | |
900 | $(objpfx)reldep6: $(libdl) | |
901 | $(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so | |
2e36cb48 | 902 | |
a41d8a74 UD |
903 | $(objpfx)reldep7: $(libdl) |
904 | $(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so | |
905 | ||
cfaf5e56 UD |
906 | $(objpfx)reldep8: $(libdl) |
907 | $(objpfx)reldep8.out: $(objpfx)reldep8mod3.so | |
908 | ||
aff4519d UD |
909 | LDFLAGS-nodel2mod2.so = -Wl,--enable-new-dtags,-z,nodelete |
910 | $(objpfx)nodelete2: $(libdl) | |
911 | $(objpfx)nodelete2.out: $(objpfx)nodel2mod3.so | |
912 | ||
913 | $(objpfx)reldep9: $(libdl) | |
914 | $(objpfx)reldep9.out: $(objpfx)reldep9mod3.so | |
915 | ||
2e36cb48 | 916 | $(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so |
aed283dd UD |
917 | |
918 | $(objpfx)tst-tls4: $(libdl) | |
919 | $(objpfx)tst-tls4.out: $(objpfx)tst-tlsmod2.so | |
920 | ||
921 | $(objpfx)tst-tls5: $(libdl) | |
922 | $(objpfx)tst-tls5.out: $(objpfx)tst-tlsmod2.so | |
bb4cb252 UD |
923 | |
924 | $(objpfx)tst-tls6: $(libdl) | |
925 | $(objpfx)tst-tls6.out: $(objpfx)tst-tlsmod2.so | |
fc093be1 UD |
926 | |
927 | $(objpfx)tst-tls7: $(libdl) | |
928 | $(objpfx)tst-tls7.out: $(objpfx)tst-tlsmod3.so | |
ebda6173 UD |
929 | |
930 | $(objpfx)tst-tls8: $(libdl) | |
931 | $(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so | |
6ef518c3 RM |
932 | |
933 | $(objpfx)tst-tls9: $(libdl) | |
934 | $(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so | |
935 | ||
702e8f14 | 936 | $(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so $(objpfx)tst-tlsmod7.so |
94c24227 | 937 | |
702e8f14 | 938 | $(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so $(objpfx)tst-tlsmod9.so |
94c24227 | 939 | |
702e8f14 | 940 | $(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so $(objpfx)tst-tlsmod11.so |
94c24227 | 941 | |
541765b6 UD |
942 | $(objpfx)tst-tls13: $(libdl) |
943 | $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so | |
944 | ||
167d5acc UD |
945 | $(objpfx)tst-tls14: $(objpfx)tst-tlsmod14a.so $(libdl) |
946 | $(objpfx)tst-tls14.out: $(objpfx)tst-tlsmod14b.so | |
947 | ||
948 | $(objpfx)tst-tls15: $(libdl) | |
949 | $(objpfx)tst-tls15.out: $(objpfx)tst-tlsmod15a.so $(objpfx)tst-tlsmod15b.so | |
99fe3b0e | 950 | |
d78efd9f RM |
951 | $(objpfx)tst-tls-dlinfo: $(libdl) |
952 | $(objpfx)tst-tls-dlinfo.out: $(objpfx)tst-tlsmod2.so | |
953 | ||
954 | ||
955 | ||
4c533566 UD |
956 | $(objpfx)tst-tls16: $(libdl) |
957 | $(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so | |
958 | ||
60a23f5a UD |
959 | $(objpfx)tst-tls17: $(libdl) |
960 | $(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so | |
1f20b93a AS |
961 | $(patsubst %,$(objpfx)%.os,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.os: tst-tlsmod17a.c |
962 | $(compile-command.c) -DN=$* | |
963 | $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so | |
964 | $(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules)) | |
60a23f5a | 965 | |
41e25904 | 966 | $(objpfx)tst-tls18: $(libdl) |
1f20b93a AS |
967 | $(objpfx)tst-tls18.out: $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules)) |
968 | $(patsubst %,$(objpfx)%.os,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.os : tst-tlsmod18a.c | |
969 | $(compile-command.c) -DN=$* | |
970 | $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so | |
41e25904 | 971 | |
d26dfc60 MG |
972 | $(objpfx)tst-tls19: $(libdl) |
973 | $(objpfx)tst-tls19.out: $(objpfx)tst-tls19mod1.so | |
974 | ||
36975e8e L |
975 | CFLAGS-tst-align.c += $(stack-align-test-flags) |
976 | CFLAGS-tst-align2.c += $(stack-align-test-flags) | |
977 | CFLAGS-tst-alignmod.c += $(stack-align-test-flags) | |
978 | CFLAGS-tst-alignmod2.c += $(stack-align-test-flags) | |
06f6ca90 UD |
979 | $(objpfx)tst-align: $(libdl) |
980 | $(objpfx)tst-align.out: $(objpfx)tst-alignmod.so | |
be184b1d | 981 | $(objpfx)tst-align2: $(objpfx)tst-alignmod2.so |
06f6ca90 | 982 | |
fab0abb4 UD |
983 | $(objpfx)unload3: $(libdl) |
984 | $(objpfx)unload3.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \ | |
985 | $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so | |
986 | ||
20fe49b9 UD |
987 | $(objpfx)unload4: $(libdl) |
988 | $(objpfx)unload4.out: $(objpfx)unload4mod1.so $(objpfx)unload4mod3.so | |
989 | ||
990 | $(objpfx)unload5: $(libdl) | |
991 | $(objpfx)unload5.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \ | |
992 | $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so | |
993 | ||
bfc832cc UD |
994 | $(objpfx)unload6: $(libdl) |
995 | $(objpfx)unload6.out: $(objpfx)unload6mod1.so $(objpfx)unload6mod2.so \ | |
996 | $(objpfx)unload6mod3.so | |
997 | ||
1ee2ff20 UD |
998 | $(objpfx)unload7: $(libdl) |
999 | $(objpfx)unload7.out: $(objpfx)unload7mod1.so $(objpfx)unload7mod2.so | |
1000 | unload7-ENV = MALLOC_PERTURB_=85 | |
1001 | ||
39dd69df AS |
1002 | $(objpfx)unload8: $(libdl) |
1003 | $(objpfx)unload8.out: $(objpfx)unload8mod1.so $(objpfx)unload8mod1x.so | |
1004 | ||
6ef518c3 RM |
1005 | ifdef libdl |
1006 | $(objpfx)tst-tls9-static: $(common-objpfx)dlfcn/libdl.a | |
1007 | $(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so | |
1008 | endif | |
dfe4c900 | 1009 | |
2abf9ff1 RM |
1010 | ifeq ($(have-z-execstack),yes) |
1011 | $(objpfx)tst-execstack: $(libdl) | |
1012 | $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so | |
36975e8e | 1013 | CPPFLAGS-tst-execstack.c += -DUSE_PTHREADS=0 |
2abf9ff1 | 1014 | LDFLAGS-tst-execstack = -Wl,-z,noexecstack |
41432ebe | 1015 | LDFLAGS-tst-execstack-mod.so = -Wl,-z,execstack |
2abf9ff1 RM |
1016 | |
1017 | $(objpfx)tst-execstack-needed: $(objpfx)tst-execstack-mod.so | |
1018 | LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack | |
c70ba488 RM |
1019 | |
1020 | LDFLAGS-tst-execstack-prog = -Wl,-z,execstack | |
b9205857 RH |
1021 | CFLAGS-tst-execstack-prog.c += -Wno-trampolines |
1022 | CFLAGS-tst-execstack-mod.c += -Wno-trampolines | |
2abf9ff1 RM |
1023 | endif |
1024 | ||
5655a0b5 AC |
1025 | LDFLAGS-tst-array2 = $(no-as-needed) |
1026 | LDFLAGS-tst-array5 = $(no-as-needed) | |
1027 | ||
6e89caf1 | 1028 | $(objpfx)tst-array1-cmp.out: tst-array1.exp $(objpfx)tst-array1.out |
f0881698 JM |
1029 | cmp $^ > $@; \ |
1030 | $(evaluate-test) | |
6e89caf1 JM |
1031 | |
1032 | $(objpfx)tst-array1-static-cmp.out: tst-array1.exp \ | |
1033 | $(objpfx)tst-array1-static.out | |
f0881698 JM |
1034 | cmp $^ > $@; \ |
1035 | $(evaluate-test) | |
43c59a70 | 1036 | |
dfe4c900 | 1037 | $(objpfx)tst-array2: $(objpfx)tst-array2dep.so |
6e89caf1 | 1038 | $(objpfx)tst-array2-cmp.out: tst-array2.exp $(objpfx)tst-array2.out |
f0881698 JM |
1039 | cmp $^ > $@; \ |
1040 | $(evaluate-test) | |
dfe4c900 | 1041 | |
6e89caf1 | 1042 | $(objpfx)tst-array3-cmp.out: tst-array1.exp $(objpfx)tst-array3.out |
f0881698 JM |
1043 | cmp $^ > $@; \ |
1044 | $(evaluate-test) | |
efd56f53 | 1045 | |
62f29da7 | 1046 | $(objpfx)tst-array4: $(libdl) |
6e89caf1 JM |
1047 | $(objpfx)tst-array4.out: $(objpfx)tst-array2dep.so |
1048 | $(objpfx)tst-array4-cmp.out: tst-array4.exp $(objpfx)tst-array4.out | |
f0881698 JM |
1049 | cmp $^ > $@; \ |
1050 | $(evaluate-test) | |
efd56f53 | 1051 | |
04395c90 | 1052 | $(objpfx)tst-array5: $(objpfx)tst-array5dep.so |
6e89caf1 | 1053 | $(objpfx)tst-array5-cmp.out: tst-array5.exp $(objpfx)tst-array5.out |
f0881698 JM |
1054 | cmp $^ > $@; \ |
1055 | $(evaluate-test) | |
04395c90 | 1056 | |
6e89caf1 JM |
1057 | $(objpfx)tst-array5-static-cmp.out: tst-array5-static.exp \ |
1058 | $(objpfx)tst-array5-static.out | |
f0881698 JM |
1059 | cmp $^ > $@; \ |
1060 | $(evaluate-test) | |
04395c90 | 1061 | |
7b91359b | 1062 | CFLAGS-tst-pie1.c += $(pie-ccflag) |
798212a0 | 1063 | CFLAGS-tst-pie2.c += $(pie-ccflag) |
f17ed1a9 | 1064 | |
c23de0aa | 1065 | $(objpfx)tst-piemod1.so: $(libsupport) |
da62f81b | 1066 | $(objpfx)tst-pie1: $(objpfx)tst-piemod1.so |
f17ed1a9 | 1067 | |
efd56f53 | 1068 | ifeq (yes,$(build-shared)) |
f753fa7d L |
1069 | # NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with |
1070 | # all-built-dso here. | |
da53d6db | 1071 | all-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \ |
82a79e7d RM |
1072 | $(filter-out $(common-objpfx)linkobj/libc.so, \ |
1073 | $(sort $(wildcard $(addprefix $(common-objpfx), \ | |
1074 | */lib*.so \ | |
1075 | iconvdata/*.so)))) | |
1f20b93a | 1076 | |
82a79e7d RM |
1077 | $(all-built-dso:=.dyn): %.dyn: % |
1078 | @rm -f $@T | |
1079 | LC_ALL=C $(READELF) -W -d $< > $@T | |
1080 | test -s $@T | |
1081 | mv -f $@T $@ | |
d3dfcc41 | 1082 | common-generated += $(all-built-dso:$(common-objpfx)%=%.dyn) |
82a79e7d RM |
1083 | |
1084 | $(objpfx)check-textrel.out: $(..)scripts/check-textrel.awk \ | |
1085 | $(all-built-dso:=.dyn) | |
f0881698 JM |
1086 | LC_ALL=C $(AWK) -f $^ > $@; \ |
1087 | $(evaluate-test) | |
82a79e7d | 1088 | generated += check-textrel.out |
bed12f78 | 1089 | |
82397ed6 RM |
1090 | $(objpfx)execstack-default: $(first-word $(wildcard $(sysdirs:%=%/stackinfo.h))) |
1091 | $(make-target-directory) | |
1092 | { echo '#include <elf.h>'; \ | |
1093 | echo '#include <stackinfo.h>'; \ | |
1094 | echo '#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \ | |
1095 | echo '@@@execstack-no@@@'; \ | |
1096 | echo '#else'; \ | |
1097 | echo '@@@execstack-yes@@@'; \ | |
1098 | echo '#endif'; } | \ | |
1099 | $(CC) $(CFLAGS) $(CPPFLAGS) -E -x c-header - | \ | |
1100 | sed -n -e 's/^@@@\(.*\)@@@/\1/p' > $@T | |
1101 | mv -f $@T $@ | |
1102 | generated += execstack-default | |
1103 | ||
1104 | $(all-built-dso:=.phdr): %.phdr: % | |
1105 | @rm -f $@T | |
1106 | LC_ALL=C $(READELF) -W -l $< > $@T | |
1107 | test -s $@T | |
1108 | mv -f $@T $@ | |
d3dfcc41 | 1109 | common-generated += $(all-built-dso:$(common-objpfx)%=%.phdr) |
82397ed6 RM |
1110 | |
1111 | $(objpfx)check-execstack.out: $(..)scripts/check-execstack.awk \ | |
1112 | $(objpfx)execstack-default \ | |
1113 | $(all-built-dso:=.phdr) | |
2d5c41de | 1114 | LC_ALL=C $(AWK) -v "xfail=$(check-execstack-xfail)" -f $^ > $@; \ |
f0881698 | 1115 | $(evaluate-test) |
82397ed6 | 1116 | generated += check-execstack.out |
774f5a30 | 1117 | |
bed12f78 UD |
1118 | $(objpfx)tst-dlmodcount: $(libdl) |
1119 | $(objpfx)tst-dlmodcount.out: $(test-modules) | |
1120 | ||
90fe4186 RM |
1121 | $(all-built-dso:=.jmprel): %.jmprel: % Makefile |
1122 | @rm -f $@T | |
1123 | LC_ALL=C $(READELF) -W -S -d -r $< > $@T | |
1124 | test -s $@T | |
1125 | mv -f $@T $@ | |
d3dfcc41 | 1126 | common-generated += $(all-built-dso:$(common-objpfx)%=%.jmprel) |
90fe4186 | 1127 | |
90fe4186 RM |
1128 | localplt-built-dso := $(addprefix $(common-objpfx),\ |
1129 | libc.so \ | |
da53d6db | 1130 | elf/ld.so \ |
90fe4186 RM |
1131 | math/libm.so \ |
1132 | rt/librt.so \ | |
1133 | dlfcn/libdl.so \ | |
1134 | resolv/libresolv.so \ | |
90fe4186 | 1135 | ) |
829a679f AS |
1136 | ifeq ($(build-mathvec),yes) |
1137 | localplt-built-dso += $(addprefix $(common-objpfx), mathvec/libmvec.so) | |
1138 | endif | |
d9266ea0 | 1139 | ifeq ($(have-thread-library),yes) |
90fe4186 | 1140 | localplt-built-dso += $(filter-out %_nonshared.a, $(shared-thread-library)) |
d9266ea0 | 1141 | endif |
e69d994a ZW |
1142 | ifeq ($(build-crypt),yes) |
1143 | localplt-built-dso += $(addprefix $(common-objpfx), crypt/libcrypt.so) | |
1144 | endif | |
d9266ea0 | 1145 | |
0f48659e JM |
1146 | vpath localplt.data $(+sysdep_dirs) |
1147 | ||
90fe4186 RM |
1148 | $(objpfx)check-localplt.out: $(..)scripts/check-localplt.awk \ |
1149 | $(..)scripts/localplt.awk \ | |
1150 | $(localplt-built-dso:=.jmprel) \ | |
0f48659e JM |
1151 | localplt.data |
1152 | LC_ALL=C $(AWK) -f $(filter-out $< %localplt.data,$^) | \ | |
1153 | LC_ALL=C $(AWK) -f $< $(filter %localplt.data,$^) - \ | |
f0881698 JM |
1154 | > $@; \ |
1155 | $(evaluate-test) | |
3baf2e9b | 1156 | endif |
28977c2c | 1157 | |
67c05796 L |
1158 | $(all-built-dso:=.dynsym): %.dynsym: % |
1159 | @rm -f $@T | |
1160 | LC_ALL=C $(READELF) -W --dyn-syms $< > $@T | |
1161 | test -s $@T | |
1162 | mv -f $@T $@ | |
1163 | common-generated += $(all-built-dso:$(common-objpfx)%=%.dynsym) | |
1164 | ||
1165 | $(objpfx)check-initfini.out: $(..)scripts/check-initfini.awk \ | |
1166 | $(all-built-dso:=.dynsym) | |
1167 | LC_ALL=C $(AWK) -f $^ > $@; \ | |
1168 | $(evaluate-test) | |
1169 | generated += check-initfini.out | |
1170 | ||
28977c2c UD |
1171 | $(objpfx)tst-dlopenrpathmod.so: $(libdl) |
1172 | $(objpfx)tst-dlopenrpath: $(objpfx)tst-dlopenrpathmod.so $(libdl) | |
1173 | CFLAGS-tst-dlopenrpath.c += -DPFX=\"$(objpfx)\" | |
1174 | LDFLAGS-tst-dlopenrpathmod.so += -Wl,-rpath,\$$ORIGIN/test-subdir | |
1175 | $(objpfx)tst-dlopenrpath.out: $(objpfx)firstobj.so | |
1fc07491 UD |
1176 | |
1177 | $(objpfx)tst-deep1mod2.so: $(objpfx)tst-deep1mod3.so | |
1178 | $(objpfx)tst-deep1: $(libdl) $(objpfx)tst-deep1mod1.so | |
1179 | $(objpfx)tst-deep1.out: $(objpfx)tst-deep1mod2.so | |
1180 | LDFLAGS-tst-deep1 += -rdynamic | |
1181 | tst-deep1mod3.so-no-z-defs = yes | |
c0f62c56 UD |
1182 | |
1183 | $(objpfx)tst-dlmopen1mod.so: $(libdl) | |
1184 | $(objpfx)tst-dlmopen1: $(libdl) | |
1185 | $(objpfx)tst-dlmopen1.out: $(objpfx)tst-dlmopen1mod.so | |
1186 | ||
1187 | $(objpfx)tst-dlmopen2: $(libdl) | |
1188 | $(objpfx)tst-dlmopen2.out: $(objpfx)tst-dlmopen1mod.so | |
b1f68750 UD |
1189 | |
1190 | $(objpfx)tst-dlmopen3: $(libdl) | |
1191 | $(objpfx)tst-dlmopen3.out: $(objpfx)tst-dlmopen1mod.so | |
9dcafc55 UD |
1192 | |
1193 | $(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so | |
1194 | tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so | |
fab0abb4 | 1195 | |
58007e9e L |
1196 | $(objpfx)tst-audit2: $(libdl) |
1197 | $(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so $(objpfx)tst-auditmod9b.so | |
51225803 AS |
1198 | # Prevent GCC-5 from translating a malloc/memset pair into calloc |
1199 | CFLAGS-tst-audit2.c += -fno-builtin | |
cafdfdb6 RM |
1200 | tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so |
1201 | ||
d0503676 CD |
1202 | $(objpfx)tst-audit9: $(libdl) |
1203 | $(objpfx)tst-audit9.out: $(objpfx)tst-auditmod9a.so $(objpfx)tst-auditmod9b.so | |
1204 | tst-audit9-ENV = LD_AUDIT=$(objpfx)tst-auditmod9a.so | |
1205 | ||
79520f4b | 1206 | $(objpfx)tst-audit8: $(libm) |
2e64d265 L |
1207 | $(objpfx)tst-audit8.out: $(objpfx)tst-auditmod1.so |
1208 | tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so | |
1209 | ||
fab0abb4 UD |
1210 | $(objpfx)tst-global1: $(libdl) |
1211 | $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so | |
3d786f19 UD |
1212 | |
1213 | $(objpfx)order2: $(libdl) | |
6e89caf1 JM |
1214 | $(objpfx)order2.out: $(objpfx)order2mod1.so $(objpfx)order2mod2.so |
1215 | $(objpfx)order2-cmp.out: $(objpfx)order2.out | |
f0881698 JM |
1216 | (echo "12345" | cmp $< -) > $@; \ |
1217 | $(evaluate-test) | |
3d786f19 UD |
1218 | $(objpfx)order2mod1.so: $(objpfx)order2mod4.so |
1219 | $(objpfx)order2mod4.so: $(objpfx)order2mod3.so | |
1220 | $(objpfx)order2mod2.so: $(objpfx)order2mod3.so | |
1221 | order2mod2.so-no-z-defs = yes | |
d4c2917f AM |
1222 | LDFLAGS-order2mod1.so = $(no-as-needed) |
1223 | LDFLAGS-order2mod2.so = $(no-as-needed) | |
35f1e827 | 1224 | |
740b3dbe | 1225 | tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child" |
35f1e827 | 1226 | tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child" |
2e0fc40c | 1227 | |
c61b4d41 | 1228 | tst-ptrguard1-ARGS = --command "$(host-test-program-cmd) --child" |
0b1f8e35 CD |
1229 | # When built statically, the pointer guard interface uses |
1230 | # __pointer_chk_guard_local. | |
36975e8e | 1231 | CFLAGS-tst-ptrguard1-static.c += -DPTRGUARD_LOCAL |
c61b4d41 CD |
1232 | tst-ptrguard1-static-ARGS = --command "$(objpfx)tst-ptrguard1-static --child" |
1233 | ||
2e0fc40c | 1234 | $(objpfx)tst-leaks1: $(libdl) |
0b20a9e8 | 1235 | $(objpfx)tst-leaks1-mem.out: $(objpfx)tst-leaks1.out |
f0881698 JM |
1236 | $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@; \ |
1237 | $(evaluate-test) | |
2e0fc40c | 1238 | |
f2eed205 | 1239 | $(objpfx)tst-leaks1-static: $(common-objpfx)dlfcn/libdl.a |
0b20a9e8 | 1240 | $(objpfx)tst-leaks1-static-mem.out: $(objpfx)tst-leaks1-static.out |
f0881698 JM |
1241 | $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1-static.mtrace > $@; \ |
1242 | $(evaluate-test) | |
f2eed205 | 1243 | |
2e0fc40c | 1244 | tst-leaks1-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1.mtrace |
f2eed205 | 1245 | tst-leaks1-static-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1-static.mtrace |
93b53ca2 UD |
1246 | |
1247 | $(objpfx)tst-addr1: $(libdl) | |
ffd0e1b7 UD |
1248 | |
1249 | $(objpfx)tst-thrlock: $(libdl) $(shared-thread-library) | |
a42faf59 | 1250 | $(objpfx)tst-dlopen-aout: $(libdl) $(shared-thread-library) |
2f083d75 L |
1251 | |
1252 | CFLAGS-ifuncmain1pic.c += $(pic-ccflag) | |
1253 | CFLAGS-ifuncmain1picstatic.c += $(pic-ccflag) | |
1254 | CFLAGS-ifuncmain1staticpic.c += $(pic-ccflag) | |
1255 | CFLAGS-ifuncdep1pic.c += $(pic-ccflag) | |
1256 | CFLAGS-ifuncmain1vispic.c += $(pic-ccflag) | |
1257 | CFLAGS-ifuncmain2pic.c += $(pic-ccflag) | |
1258 | CFLAGS-ifuncmain2picstatic.c += $(pic-ccflag) | |
1259 | CFLAGS-ifuncdep2pic.c += $(pic-ccflag) | |
1260 | CFLAGS-ifuncmain4picstatic.c += $(pic-ccflag) | |
3c30afc8 L |
1261 | CFLAGS-ifuncmain5pic.c += $(pic-ccflag) |
1262 | CFLAGS-ifuncmain5picstatic.c += $(pic-ccflag) | |
1263 | CFLAGS-ifuncmain5staticpic.c += $(pic-ccflag) | |
1264 | CFLAGS-ifuncdep5pic.c += $(pic-ccflag) | |
1265 | CFLAGS-ifuncmain7pic.c += $(pic-ccflag) | |
1266 | CFLAGS-ifuncmain7picstatic.c += $(pic-ccflag) | |
2f083d75 L |
1267 | |
1268 | LDFLAGS-ifuncmain3 = -Wl,-export-dynamic | |
1269 | ||
2f083d75 L |
1270 | CFLAGS-ifuncmain1pie.c += $(pie-ccflag) |
1271 | CFLAGS-ifuncmain1vispie.c += $(pie-ccflag) | |
3c30afc8 L |
1272 | CFLAGS-ifuncmain1staticpie.c += $(pie-ccflag) |
1273 | CFLAGS-ifuncmain5pie.c += $(pie-ccflag) | |
1274 | CFLAGS-ifuncmain6pie.c += $(pie-ccflag) | |
1275 | CFLAGS-ifuncmain7pie.c += $(pie-ccflag) | |
b5c45e83 | 1276 | CFLAGS-tst-ifunc-textrel.c += $(pic-ccflag) |
2f083d75 | 1277 | |
da62f81b AS |
1278 | $(objpfx)ifuncmain1pie: $(objpfx)ifuncmod1.so |
1279 | $(objpfx)ifuncmain1staticpie: $(objpfx)ifuncdep1pic.o | |
1280 | $(objpfx)ifuncmain1vispie: $(objpfx)ifuncmod1.so | |
1281 | $(objpfx)ifuncmain5pie: $(objpfx)ifuncmod5.so | |
1282 | $(objpfx)ifuncmain6pie: $(objpfx)ifuncmod6.so | |
2f083d75 L |
1283 | |
1284 | $(objpfx)ifuncmain1: $(addprefix $(objpfx),ifuncmod1.so) | |
1285 | $(objpfx)ifuncmain1pic: $(addprefix $(objpfx),ifuncmod1.so) | |
1286 | $(objpfx)ifuncmain1staticpic: $(addprefix $(objpfx),ifuncdep1pic.o) | |
1287 | $(objpfx)ifuncmain1static: $(addprefix $(objpfx),ifuncdep1.o) | |
1288 | $(objpfx)ifuncmain1picstatic: $(addprefix $(objpfx),ifuncdep1pic.o) | |
1289 | $(objpfx)ifuncmain1vis: $(addprefix $(objpfx),ifuncmod1.so) | |
1290 | $(objpfx)ifuncmain1vispic: $(addprefix $(objpfx),ifuncmod1.so) | |
1291 | $(objpfx)ifuncmain2: $(addprefix $(objpfx),ifuncdep2.o) | |
1292 | $(objpfx)ifuncmain2pic: $(addprefix $(objpfx),ifuncdep2pic.o) | |
1293 | $(objpfx)ifuncmain2static: $(addprefix $(objpfx),ifuncdep2.o) | |
1294 | $(objpfx)ifuncmain2picstatic: $(addprefix $(objpfx),ifuncdep2pic.o) | |
1295 | ||
1296 | $(objpfx)ifuncmain3: $(libdl) | |
1297 | $(objpfx)ifuncmain3.out: $(objpfx)ifuncmod3.so | |
3c30afc8 L |
1298 | |
1299 | $(objpfx)ifuncmain5: $(addprefix $(objpfx),ifuncmod5.so) | |
1300 | $(objpfx)ifuncmain5pic: $(addprefix $(objpfx),ifuncmod5.so) | |
1301 | $(objpfx)ifuncmain5static: $(addprefix $(objpfx),ifuncdep5.o) | |
1302 | $(objpfx)ifuncmain5staticpic: $(addprefix $(objpfx),ifuncdep5pic.o) | |
1303 | $(objpfx)ifuncmain5picstatic: $(addprefix $(objpfx),ifuncdep5pic.o) | |
415ac3df UD |
1304 | |
1305 | $(objpfx)tst-unique1: $(libdl) | |
1306 | $(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \ | |
1307 | $(objpfx)tst-unique1mod2.so | |
1308 | ||
1309 | $(objpfx)tst-unique2: $(libdl) $(objpfx)tst-unique2mod1.so | |
1310 | $(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so | |
b0ecde3a | 1311 | |
028478fa UD |
1312 | $(objpfx)tst-unique3: $(libdl) $(objpfx)tst-unique3lib.so |
1313 | $(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so | |
33f85a3f | 1314 | |
320a5dc0 PB |
1315 | $(objpfx)tst-unique4: $(objpfx)tst-unique4lib.so |
1316 | ||
02d5e5d9 PK |
1317 | $(objpfx)tst-nodelete: $(libdl) |
1318 | $(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \ | |
1319 | $(objpfx)tst-nodelete-rtldmod.so \ | |
1320 | $(objpfx)tst-nodelete-zmod.so | |
1321 | ||
1322 | LDFLAGS-tst-nodelete = -rdynamic | |
1323 | LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete | |
1324 | ||
f25238ff MO |
1325 | $(objpfx)tst-nodelete2: $(libdl) |
1326 | $(objpfx)tst-nodelete2.out: $(objpfx)tst-nodelete2mod.so | |
1327 | ||
1328 | LDFLAGS-tst-nodelete2 = -rdynamic | |
1329 | ||
6e89caf1 | 1330 | $(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out |
f0881698 JM |
1331 | cmp $^ > $@; \ |
1332 | $(evaluate-test) | |
968dad0a | 1333 | |
e888bcbe AS |
1334 | $(objpfx)tst-initorder2: $(objpfx)tst-initorder2a.so $(objpfx)tst-initorder2d.so $(objpfx)tst-initorder2c.so |
1335 | $(objpfx)tst-initorder2a.so: $(objpfx)tst-initorder2b.so | |
1336 | $(objpfx)tst-initorder2b.so: $(objpfx)tst-initorder2c.so | |
1337 | $(objpfx)tst-initorder2c.so: $(objpfx)tst-initorder2d.so | |
d4c2917f AM |
1338 | LDFLAGS-tst-initorder2 = $(no-as-needed) |
1339 | LDFLAGS-tst-initorder2a.so = $(no-as-needed) | |
1340 | LDFLAGS-tst-initorder2b.so = $(no-as-needed) | |
1341 | LDFLAGS-tst-initorder2c.so = $(no-as-needed) | |
e888bcbe AS |
1342 | define o-iterator-doit |
1343 | $(objpfx)tst-initorder2$o.os: tst-initorder2.c; \ | |
1344 | $$(compile-command.c) -DNAME=\"$o\" | |
1345 | endef | |
1346 | object-suffixes-left := a b c d | |
1347 | include $(o-iterator) | |
1348 | ||
6e89caf1 | 1349 | $(objpfx)tst-initorder2-cmp.out: tst-initorder2.exp $(objpfx)tst-initorder2.out |
f0881698 JM |
1350 | cmp $^ > $@; \ |
1351 | $(evaluate-test) | |
e888bcbe | 1352 | |
6ee65ed6 UD |
1353 | $(objpfx)tst-relsort1: $(libdl) |
1354 | $(objpfx)tst-relsort1mod1.so: $(libm) $(objpfx)tst-relsort1mod2.so | |
1355 | $(objpfx)tst-relsort1mod2.so: $(libm) | |
1356 | $(objpfx)tst-relsort1.out: $(objpfx)tst-relsort1mod1.so \ | |
1357 | $(objpfx)tst-relsort1mod2.so | |
1f393a11 | 1358 | |
1f393a11 | 1359 | $(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so |
cc1290d0 | 1360 | $(test-wrapper-env) \ |
1f393a11 MP |
1361 | LD_TRACE_LOADED_OBJECTS=1 \ |
1362 | LD_DEBUG=unused \ | |
1363 | LD_PRELOAD= \ | |
85d89278 | 1364 | $(rtld-prefix) \ |
f0881698 JM |
1365 | $< > $@; \ |
1366 | $(evaluate-test) | |
6e89caf1 JM |
1367 | |
1368 | $(objpfx)tst-unused-dep-cmp.out: $(objpfx)tst-unused-dep.out | |
f0881698 JM |
1369 | cmp $< /dev/null > $@; \ |
1370 | $(evaluate-test) | |
a1b85ae8 FW |
1371 | |
1372 | $(objpfx)tst-audit11.out: $(objpfx)tst-auditmod11.so $(objpfx)tst-audit11mod1.so | |
1373 | $(objpfx)tst-audit11: $(libdl) | |
1374 | tst-audit11-ENV = LD_AUDIT=$(objpfx)tst-auditmod11.so | |
1375 | $(objpfx)tst-audit11mod1.so: $(objpfx)tst-audit11mod2.so | |
1376 | LDFLAGS-tst-audit11mod2.so = -Wl,--version-script=tst-audit11mod2.map,-soname,tst-audit11mod2.so | |
1377 | ||
1378 | $(objpfx)tst-audit12.out: $(objpfx)tst-auditmod12.so $(objpfx)tst-audit12mod1.so $(objpfx)tst-audit12mod3.so | |
1379 | $(objpfx)tst-audit12: $(libdl) | |
1380 | tst-audit12-ENV = LD_AUDIT=$(objpfx)tst-auditmod12.so | |
1381 | $(objpfx)tst-audit12mod1.so: $(objpfx)tst-audit12mod2.so | |
1382 | LDFLAGS-tst-audit12mod2.so = -Wl,--version-script=tst-audit12mod2.map | |
89569c8b | 1383 | |
9e78f6f6 FW |
1384 | # Override -z defs, so that we can reference an undefined symbol. |
1385 | # Force lazy binding for the same reason. | |
1386 | LDFLAGS-tst-latepthreadmod.so = \ | |
1387 | -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all | |
f91d3fd6 SL |
1388 | # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for |
1389 | # function this_function_is_not_defined. | |
36975e8e | 1390 | CFLAGS-tst-latepthreadmod.c += -fno-optimize-sibling-calls |
9e78f6f6 FW |
1391 | $(objpfx)tst-latepthreadmod.so: $(shared-thread-library) |
1392 | $(objpfx)tst-latepthread: $(libdl) | |
1393 | $(objpfx)tst-latepthread.out: $(objpfx)tst-latepthreadmod.so | |
1394 | ||
01b23a30 FW |
1395 | # The test modules are parameterized by preprocessor macros. |
1396 | $(patsubst %,$(objpfx)%.os,$(tst-tls-many-dynamic-modules)): \ | |
1397 | $(objpfx)tst-tls-manydynamic%mod.os : tst-tls-manydynamicmod.c | |
1398 | $(compile-command.c) \ | |
1399 | -DNAME=tls_global_$* -DSETTER=set_value_$* -DGETTER=get_value_$* | |
1400 | $(objpfx)tst-tls-manydynamic: $(libdl) $(shared-thread-library) | |
1401 | $(objpfx)tst-tls-manydynamic.out: \ | |
1402 | $(patsubst %,$(objpfx)%.so,$(tst-tls-many-dynamic-modules)) | |
1403 | ||
89569c8b L |
1404 | tst-prelink-ENV = LD_TRACE_PRELINKING=1 |
1405 | ||
1406 | $(objpfx)tst-prelink-conflict.out: $(objpfx)tst-prelink.out | |
1407 | grep stdout $< | grep conflict | $(AWK) '{ print $$10, $$11 }' > $@ | |
1408 | ||
1409 | $(objpfx)tst-prelink-cmp.out: tst-prelink.exp \ | |
1410 | $(objpfx)tst-prelink-conflict.out | |
1411 | cmp $^ > $@; \ | |
1412 | $(evaluate-test) | |
920b35c9 FW |
1413 | |
1414 | $(objpfx)tst-ldconfig-X.out : tst-ldconfig-X.sh $(objpfx)ldconfig | |
d4d629e6 JM |
1415 | $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' \ |
1416 | '$(run-program-env)' > $@; \ | |
920b35c9 | 1417 | $(evaluate-test) |
7d45c163 FW |
1418 | |
1419 | $(objpfx)tst-dlsym-error: $(libdl) | |
a0f83f0b | 1420 | |
84aa7516 CD |
1421 | # Test static linking of all the libraries we can possibly link |
1422 | # together. Note that in some configurations this may be less than the | |
1423 | # complete list of libraries we build but we try to maxmimize this list. | |
a0f83f0b FW |
1424 | $(objpfx)tst-linkall-static: \ |
1425 | $(common-objpfx)math/libm.a \ | |
a0f83f0b FW |
1426 | $(common-objpfx)resolv/libresolv.a \ |
1427 | $(common-objpfx)dlfcn/libdl.a \ | |
1428 | $(common-objpfx)login/libutil.a \ | |
1429 | $(common-objpfx)rt/librt.a \ | |
1430 | $(common-objpfx)resolv/libanl.a \ | |
84aa7516 CD |
1431 | $(static-thread-library) |
1432 | ||
e69d994a | 1433 | ifeq ($(build-crypt),yes) |
84aa7516 CD |
1434 | # If we are using NSS crypto and we have the ability to link statically |
1435 | # then we include libcrypt.a, otherwise we leave out libcrypt.a and | |
1436 | # link as much as we can into the tst-linkall-static test. This assumes | |
1437 | # that linking with libcrypt.a does everything required to include the | |
1438 | # static NSS crypto library. | |
1439 | ifeq (yesyes,$(nss-crypt)$(static-nss-crypt)) | |
1440 | $(objpfx)tst-linkall-static: \ | |
1441 | $(common-objpfx)crypt/libcrypt.a | |
1442 | endif | |
1443 | # If we are not using NSS crypto then we always have the ability to link | |
1444 | # with libcrypt.a. | |
1445 | ifeq (no,$(nss-crypt)) | |
1446 | $(objpfx)tst-linkall-static: \ | |
1447 | $(common-objpfx)crypt/libcrypt.a | |
1448 | endif | |
e69d994a | 1449 | endif |
57707b7f CD |
1450 | |
1451 | # The application depends on the DSO, and the DSO loads the plugin. | |
1452 | # The plugin also depends on the DSO. This creates the circular | |
1453 | # dependency via dlopen that we're testing to make sure works. | |
1454 | $(objpfx)tst-nodelete-dlclose-dso.so: $(libdl) | |
1455 | $(objpfx)tst-nodelete-dlclose-plugin.so: $(objpfx)tst-nodelete-dlclose-dso.so | |
1456 | $(objpfx)tst-nodelete-dlclose: $(objpfx)tst-nodelete-dlclose-dso.so | |
1457 | $(objpfx)tst-nodelete-dlclose.out: $(objpfx)tst-nodelete-dlclose-dso.so \ | |
1458 | $(objpfx)tst-nodelete-dlclose-plugin.so | |
8b9e9c3c | 1459 | |
1c1243b6 | 1460 | tst-env-setuid-ENV = MALLOC_CHECK_=2 MALLOC_MMAP_THRESHOLD_=4096 \ |
ce79740b | 1461 | LD_HWCAP_MASK=0x1 |
8b9e9c3c SP |
1462 | tst-env-setuid-tunables-ENV = \ |
1463 | GLIBC_TUNABLES=glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096 | |
592d5c75 L |
1464 | |
1465 | $(objpfx)tst-debug1: $(libdl) | |
1466 | $(objpfx)tst-debug1.out: $(objpfx)tst-debug1mod1.so | |
1467 | ||
1468 | $(objpfx)tst-debug1mod1.so: $(objpfx)testobj1.so | |
1469 | $(OBJCOPY) --only-keep-debug $< $@ | |
5dba84b3 L |
1470 | |
1471 | $(objpfx)tst-main1: $(objpfx)tst-main1mod.so | |
1472 | CRT-tst-main1 := $(csu-objpfx)crt1.o | |
ce16eb52 | 1473 | tst-main1-no-pie = yes |
5dba84b3 L |
1474 | LDLIBS-tst-main1 = $(libsupport) |
1475 | tst-main1mod.so-no-z-defs = yes | |
82eef55f | 1476 | |
e7feec37 MR |
1477 | LDLIBS-tst-absolute-sym-lib.so = tst-absolute-sym-lib.lds |
1478 | $(objpfx)tst-absolute-sym-lib.so: $(LDLIBS-tst-absolute-sym-lib.so) | |
1479 | $(objpfx)tst-absolute-sym: $(objpfx)tst-absolute-sym-lib.so | |
1480 | ||
bac15a72 MR |
1481 | LDLIBS-tst-absolute-zero-lib.so = tst-absolute-zero-lib.lds |
1482 | $(objpfx)tst-absolute-zero-lib.so: $(LDLIBS-tst-absolute-zero-lib.so) | |
1483 | $(objpfx)tst-absolute-zero: $(objpfx)tst-absolute-zero-lib.so | |
1484 | ||
82eef55f FW |
1485 | # Both the main program and the DSO for tst-libc_dlvsym need to link |
1486 | # against libdl. | |
1487 | $(objpfx)tst-libc_dlvsym: $(libdl) | |
1488 | $(objpfx)tst-libc_dlvsym-dso.so: $(libsupport) $(libdl) | |
1489 | $(objpfx)tst-libc_dlvsym.out: $(objpfx)tst-libc_dlvsym-dso.so | |
1490 | $(objpfx)tst-libc_dlvsym-static: $(common-objpfx)dlfcn/libdl.a | |
1491 | tst-libc_dlvsym-static-ENV = \ | |
1492 | LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn | |
1493 | $(objpfx)tst-libc_dlvsym-static.out: $(objpfx)tst-libc_dlvsym-dso.so | |
0065aaaa PP |
1494 | |
1495 | $(objpfx)tst-big-note: $(objpfx)tst-big-note-lib.so | |
6ca8284e AS |
1496 | |
1497 | $(objpfx)tst-unwind-ctor: $(objpfx)tst-unwind-ctor-lib.so |