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