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