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