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