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