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