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