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