elf: Allow dlopen of filter object to work [BZ #16272]
[platform/upstream/glibc.git] / elf / Makefile
1 # Copyright (C) 1995-2020 Free Software Foundation, Inc.
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
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.
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
12 # Lesser General Public License for more details.
13
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
17
18 # Makefile for elf subdirectory of GNU C Library.
19
20 subdir          := elf
21
22 include ../Makeconfig
23
24 headers         = elf.h bits/elfclass.h link.h bits/link.h
25 routines        = $(all-dl-routines) dl-support dl-iteratephdr \
26                   dl-addr dl-addr-obj enbl-secure dl-profstub \
27                   dl-origin dl-libc dl-sym dl-sysdep dl-error \
28                   dl-reloc-static-pie
29
30 # The core dynamic linking functions are in libc for the static and
31 # profiled libraries.
32 dl-routines     = $(addprefix dl-,load lookup object reloc deps hwcaps \
33                                   runtime init fini debug misc \
34                                   version profile tls origin scope \
35                                   execstack open close trampoline \
36                                   exception sort-maps)
37 ifeq (yes,$(use-ldconfig))
38 dl-routines += dl-cache
39 endif
40
41 ifneq (no,$(have-tunables))
42 dl-routines += dl-tunables
43 tunables-type = $(addprefix TUNABLES_FRONTEND_,$(have-tunables))
44 CPPFLAGS-dl-tunables.c += -DTUNABLES_FRONTEND=$(tunables-type)
45
46 # Make sure that the compiler does not insert any library calls in tunables
47 # code paths.
48 ifeq (yes,$(have-loop-to-function))
49 CFLAGS-dl-tunables.c += -fno-tree-loop-distribute-patterns
50 endif
51 endif
52
53 all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
54 # But they are absent from the shared libc, because that code is in ld.so.
55 elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \
56                     dl-sysdep dl-exception dl-reloc-static-pie
57
58 # ld.so uses those routines, plus some special stuff for being the program
59 # interpreter and operating independent of libc.
60 rtld-routines   = rtld $(all-dl-routines) dl-sysdep dl-environ dl-minimal \
61   dl-error-minimal dl-conflict
62 all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines)
63
64 CFLAGS-dl-runtime.c += -fexceptions -fasynchronous-unwind-tables
65 CFLAGS-dl-lookup.c += -fexceptions -fasynchronous-unwind-tables
66 CFLAGS-dl-iterate-phdr.c += $(uses-callbacks)
67
68 # On targets without __builtin_memset, rtld.c uses a hand-coded loop
69 # in _dl_start.  Make sure this isn't turned into a call to regular memset.
70 ifeq (yes,$(have-loop-to-function))
71 CFLAGS-rtld.c += -fno-tree-loop-distribute-patterns
72 endif
73
74 # Compile rtld itself without stack protection.
75 # Also compile all routines in the static library that are elided from
76 # the shared libc because they are in libc.a in the same way.
77
78 define elide-stack-protector
79 $(if $(filter $(@F),$(patsubst %,%$(1),$(2))), $(no-stack-protector))
80 endef
81
82 CFLAGS-.o += $(call elide-stack-protector,.o,$(elide-routines.os))
83 CFLAGS-.op += $(call elide-stack-protector,.op,$(elide-routines.os))
84 CFLAGS-.os += $(call elide-stack-protector,.os,$(all-rtld-routines))
85
86 ifeq ($(unwind-find-fde),yes)
87 routines += unwind-dw2-fde-glibc
88 shared-only-routines += unwind-dw2-fde-glibc
89 endif
90
91 before-compile  += $(objpfx)trusted-dirs.h
92 generated       += trusted-dirs.h trusted-dirs.st for-renamed/renamed.so
93 generated-dirs  += for-renamed
94
95 ifeq ($(build-shared),yes)
96 ld-map          = $(common-objpfx)ld.map
97 endif
98
99 ifeq (yes,$(build-shared))
100 extra-objs      = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os
101 generated       += librtld.os dl-allobjs.os ld.so ldd
102 install-others  = $(inst_rtlddir)/$(rtld-installed-name)
103 install-bin-script = ldd
104 endif
105
106 others          = sprof sln
107 install-bin     = sprof
108 others-static   = sln
109 install-rootsbin = sln
110 sln-modules     := static-stubs
111 extra-objs      += $(sln-modules:=.o)
112
113 ifeq (yes,$(use-ldconfig))
114 ifeq (yes,$(build-shared))
115 others-static   += ldconfig
116 others          += ldconfig
117 install-rootsbin += ldconfig
118
119 ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon static-stubs
120 extra-objs      += $(ldconfig-modules:=.o)
121 others-extras   = $(ldconfig-modules)
122 endif
123 endif
124
125 # To find xmalloc.c and xstrdup.c
126 vpath %.c ../locale/programs
127
128 ifeq ($(build-shared),yes)
129 extra-objs += sotruss-lib.os sotruss-lib.so
130 install-others += $(inst_auditdir)/sotruss-lib.so
131 install-bin-script += sotruss
132 generated += sotruss
133 libof-sotruss-lib = extramodules
134 LDFLAGS-sotruss-lib.so += $(z-now-$(bind-now))
135 $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os
136         $(build-module-asneeded)
137 $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \
138         $(common-objpfx)libc_nonshared.a
139
140 $(objpfx)sotruss: sotruss.sh $(common-objpfx)config.make
141         sed -e 's%@BASH@%$(BASH)%g' \
142             -e 's%@VERSION@%$(version)%g' \
143             -e 's%@TEXTDOMAINDIR@%$(localedir)%g' \
144             -e 's%@PREFIX@%$(prefix)%g' \
145             -e 's|@PKGVERSION@|$(PKGVERSION)|g' \
146             -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
147             < $< > $@.new
148         chmod 555 $@.new
149         mv -f $@.new $@
150 $(inst_auditdir)/sotruss-lib.so: $(objpfx)sotruss-lib.so $(+force)
151         $(do-install-program)
152 endif
153
154 tests-static-normal := tst-leaks1-static tst-array1-static tst-array5-static \
155                tst-dl-iter-static \
156                tst-tlsalign-static tst-tlsalign-extern-static \
157                tst-linkall-static tst-env-setuid tst-env-setuid-tunables
158 tests-static-internal := tst-tls1-static tst-tls2-static \
159                tst-ptrguard1-static tst-stackguard1-static \
160                tst-tls1-static-non-pie tst-libc_dlvsym-static
161
162 CRT-tst-tls1-static-non-pie := $(csu-objpfx)crt1.o
163 tst-tls1-static-non-pie-no-pie = yes
164
165 tests-container := \
166                           tst-ldconfig-bad-aux-cache \
167                           tst-ldconfig-ld_so_conf-update
168
169 tests := tst-tls9 tst-leaks1 \
170         tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 \
171         tst-auxv
172 tests-internal := tst-tls1 tst-tls2 $(tests-static-internal)
173 tests-static := $(tests-static-normal) $(tests-static-internal)
174
175 ifeq (yes,$(build-shared))
176 tests-static += tst-tls9-static
177 tst-tls9-static-ENV = \
178        LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
179
180 tests += restest1 preloadtest loadfail multiload origtest resolvfail \
181          constload1 order noload filter \
182          reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
183          nodlopen nodlopen2 lateglobal initfirst global \
184          restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
185          tst-tls4 tst-tls5 \
186          tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
187          tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \
188          tst-align tst-align2 \
189          tst-dlmodcount tst-dlopenrpath tst-deep1 \
190          tst-dlmopen1 tst-dlmopen3 \
191          unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
192          tst-audit1 tst-audit2 tst-audit8 tst-audit9 \
193          tst-addr1 tst-thrlock \
194          tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4 \
195          tst-nodelete tst-dlopen-nodelete-reloc) \
196          tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
197          tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
198          tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload \
199          tst-latepthread tst-tls-manydynamic tst-nodelete-dlclose \
200          tst-debug1 tst-main1 tst-absolute-sym tst-absolute-zero tst-big-note \
201          tst-unwind-ctor tst-unwind-main tst-audit13 \
202          tst-sonamemove-link tst-sonamemove-dlopen tst-dlopen-tlsmodid \
203          tst-dlopen-self tst-auditmany tst-initfinilazyfail tst-dlopenfail \
204          tst-dlopenfail-2 \
205          tst-filterobj tst-filterobj-dlopen tst-auxobj tst-auxobj-dlopen
206 #        reldep9
207 tests-internal += loadtest unload unload2 circleload1 \
208          neededtest neededtest2 neededtest3 neededtest4 \
209          tst-tls3 tst-tls6 tst-tls7 tst-tls8 tst-dlmopen2 \
210          tst-ptrguard1 tst-stackguard1 tst-libc_dlvsym \
211          tst-create_format1
212 tests-container += tst-pldd tst-dlopen-tlsmodid-container \
213   tst-dlopen-self-container
214 test-srcs = tst-pathopt
215 selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null)
216 ifneq ($(selinux-enabled),1)
217 tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
218 endif
219 endif
220 tests += $(tests-execstack-$(have-z-execstack))
221 ifeq ($(run-built-tests),yes)
222 tests-special += $(objpfx)tst-leaks1-mem.out \
223                  $(objpfx)tst-leaks1-static-mem.out $(objpfx)noload-mem.out \
224                  $(objpfx)tst-ldconfig-X.out
225 endif
226 tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
227 tlsmod18a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
228 tlsmod17a-modules = $(addprefix tst-tlsmod17a, $(tlsmod17a-suffixes))
229 tlsmod18a-modules = $(addprefix tst-tlsmod18a, $(tlsmod17a-suffixes))
230 one-hundred = $(foreach x,0 1 2 3 4 5 6 7 8 9, \
231   0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x)
232 tst-tls-many-dynamic-modules := \
233   $(foreach n,$(one-hundred),tst-tls-manydynamic$(n)mod)
234 extra-test-objs += $(tlsmod17a-modules:=.os) $(tlsmod18a-modules:=.os) \
235                    tst-tlsalign-vars.o
236 test-extras += tst-tlsmod17a tst-tlsmod18a tst-tlsalign-vars
237 modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
238                 testobj1_1 failobj constload2 constload3 unloadmod \
239                 dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
240                 nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
241                 nodel2mod1 nodel2mod2 nodel2mod3 \
242                 nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
243                 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
244                 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
245                 neededobj1 neededobj2 neededobj3 neededobj4 \
246                 neededobj5 neededobj6 firstobj globalmod1 \
247                 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \
248                 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \
249                 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \
250                 reldep7mod1 reldep7mod2 \
251                 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \
252                 tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
253                 tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
254                 tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
255                 tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
256                 $(tlsmod17a-modules) tst-tlsmod17b $(tlsmod18a-modules) \
257                 tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \
258                 circlemod1 circlemod1a circlemod2 circlemod2a \
259                 circlemod3 circlemod3a \
260                 reldep8mod1 reldep8mod2 reldep8mod3 \
261                 reldep9mod1 reldep9mod2 reldep9mod3 \
262                 tst-alignmod tst-alignmod2 \
263                 $(modules-execstack-$(have-z-execstack)) \
264                 tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \
265                 tst-dlmopen1mod tst-auditmod1 \
266                 unload3mod1 unload3mod2 unload3mod3 unload3mod4 \
267                 unload4mod1 unload4mod2 unload4mod3 unload4mod4 \
268                 unload6mod1 unload6mod2 unload6mod3 \
269                 unload7mod1 unload7mod2 \
270                 unload8mod1 unload8mod1x unload8mod2 unload8mod3 \
271                 order2mod1 order2mod2 order2mod3 order2mod4 \
272                 tst-unique1mod1 tst-unique1mod2 \
273                 tst-unique2mod1 tst-unique2mod2 \
274                 tst-auditmod9a tst-auditmod9b \
275                 $(if $(CXX),tst-unique3lib tst-unique3lib2 tst-unique4lib \
276                   tst-nodelete-uniquemod tst-nodelete-rtldmod \
277                   tst-nodelete-zmod \
278                   tst-dlopen-nodelete-reloc-mod1 \
279                   tst-dlopen-nodelete-reloc-mod2 \
280                   tst-dlopen-nodelete-reloc-mod3 \
281                   tst-dlopen-nodelete-reloc-mod4 \
282                   tst-dlopen-nodelete-reloc-mod5 \
283                   tst-dlopen-nodelete-reloc-mod6 \
284                   tst-dlopen-nodelete-reloc-mod7 \
285                   tst-dlopen-nodelete-reloc-mod8 \
286                   tst-dlopen-nodelete-reloc-mod9 \
287                   tst-dlopen-nodelete-reloc-mod10 \
288                   tst-dlopen-nodelete-reloc-mod11 \
289                   tst-dlopen-nodelete-reloc-mod12 \
290                   tst-dlopen-nodelete-reloc-mod13 \
291                   tst-dlopen-nodelete-reloc-mod14 \
292                   tst-dlopen-nodelete-reloc-mod15 \
293                   tst-dlopen-nodelete-reloc-mod16 \
294                   tst-dlopen-nodelete-reloc-mod17) \
295                 tst-initordera1 tst-initorderb1 \
296                 tst-initordera2 tst-initorderb2 \
297                 tst-initordera3 tst-initordera4 \
298                 tst-initorder2a tst-initorder2b tst-initorder2c \
299                 tst-initorder2d \
300                 tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
301                 tst-array5dep tst-null-argv-lib \
302                 tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod \
303                 tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \
304                 tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \
305                 tst-latepthreadmod $(tst-tls-many-dynamic-modules) \
306                 tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \
307                 tst-main1mod tst-libc_dlvsym-dso tst-absolute-sym-lib \
308                 tst-absolute-zero-lib tst-big-note-lib tst-unwind-ctor-lib \
309                 tst-audit13mod1 tst-sonamemove-linkmod1 \
310                 tst-sonamemove-runmod1 tst-sonamemove-runmod2 \
311                 tst-auditmanymod1 tst-auditmanymod2 tst-auditmanymod3 \
312                 tst-auditmanymod4 tst-auditmanymod5 tst-auditmanymod6 \
313                 tst-auditmanymod7 tst-auditmanymod8 tst-auditmanymod9 \
314                 tst-initlazyfailmod tst-finilazyfailmod \
315                 tst-dlopenfailmod1 tst-dlopenfaillinkmod tst-dlopenfailmod2 \
316                 tst-dlopenfailmod3 tst-ldconfig-ld-mod \
317                 tst-filterobj-flt tst-filterobj-aux tst-filterobj-filtee
318 # Most modules build with _ISOMAC defined, but those filtered out
319 # depend on internal headers.
320 modules-names-tests = $(filter-out ifuncmod% tst-libc_dlvsym-dso tst-tlsmod%,\
321                                    $(modules-names))
322
323 ifeq (yes,$(have-mtls-dialect-gnu2))
324 tests += tst-gnu2-tls1
325 modules-names += tst-gnu2-tls1mod
326 $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
327 tst-gnu2-tls1mod.so-no-z-defs = yes
328 CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
329 endif
330 ifeq (yes,$(have-protected-data))
331 modules-names += tst-protected1moda tst-protected1modb
332 tests += tst-protected1a tst-protected1b
333 $(objpfx)tst-protected1a: $(addprefix $(objpfx),tst-protected1moda.so tst-protected1modb.so)
334 $(objpfx)tst-protected1b: $(addprefix $(objpfx),tst-protected1modb.so tst-protected1moda.so)
335 tst-protected1modb.so-no-z-defs = yes
336 # These tests fail with GCC versions prior to 5.1 and with some versions
337 # of binutils.  See https://sourceware.org/bugzilla/show_bug.cgi?id=17709
338 # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details.
339 # Perhaps in future we can make these XFAILs conditional on some detection
340 # of compiler/linker behavior/version.
341 test-xfail-tst-protected1a = yes
342 test-xfail-tst-protected1b = yes
343 endif
344 ifeq (yesyes,$(have-fpie)$(build-shared))
345 modules-names += tst-piemod1
346 tests += tst-pie1 tst-pie2 tst-dlopen-pie tst-dlopen-tlsmodid-pie \
347   tst-dlopen-self-pie
348 tests-pie += tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie
349 ifeq (yes,$(have-protected-data))
350 tests += vismain
351 tests-pie += vismain
352 CFLAGS-vismain.c += $(PIE-ccflag)
353 endif
354 endif
355 modules-execstack-yes = tst-execstack-mod
356 extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
357
358 # filtmod1.so, tst-big-note-lib.so have special rules.
359 modules-names-nobuild := filtmod1 tst-big-note-lib
360
361 tests += $(tests-static)
362
363 ifeq (yes,$(have-ifunc))
364 tests-ifuncstatic := ifuncmain1static ifuncmain1picstatic \
365                 ifuncmain2static ifuncmain2picstatic \
366                 ifuncmain4static ifuncmain4picstatic \
367                 ifuncmain5static ifuncmain5picstatic \
368                 ifuncmain7static ifuncmain7picstatic \
369                 ifuncmain9static ifuncmain9picstatic
370 tests-static += $(tests-ifuncstatic)
371 tests-internal += $(tests-ifuncstatic)
372 ifeq (yes,$(build-shared))
373 tests += tst-ifunc-fault-lazy tst-ifunc-fault-bindnow
374 # Note: sysdeps/x86_64/ifuncmain8.c uses ifuncmain8.
375 tests-internal += \
376          ifuncmain1 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \
377          ifuncmain1staticpic \
378          ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \
379          ifuncmain5 ifuncmain5pic ifuncmain5staticpic \
380          ifuncmain7 ifuncmain7pic \
381          ifuncmain9 ifuncmain9pic
382 ifunc-test-modules = ifuncdep1 ifuncdep1pic ifuncdep2 ifuncdep2pic \
383                      ifuncdep5 ifuncdep5pic
384 extra-test-objs += $(ifunc-test-modules:=.o)
385 test-internal-extras += $(ifunc-test-modules)
386 ifeq (yes,$(have-fpie))
387 ifunc-pie-tests = ifuncmain1pie ifuncmain1vispie ifuncmain1staticpie \
388                   ifuncmain5pie ifuncmain6pie ifuncmain7pie ifuncmain9pie
389 ifeq (yes,$(have-textrel_ifunc))
390 ifunc-pie-tests += tst-ifunc-textrel
391 endif
392 tests-internal += $(ifunc-pie-tests)
393 tests-pie += $(ifunc-pie-tests)
394 endif
395 modules-names += ifuncmod1 ifuncmod3 ifuncmod5 ifuncmod6
396 endif
397 endif
398
399 ifeq (yes,$(build-shared))
400 ifeq ($(run-built-tests),yes)
401 tests-special += $(objpfx)tst-pathopt.out $(objpfx)tst-rtld-load-self.out \
402                  $(objpfx)tst-rtld-preload.out
403 endif
404 tests-special += $(objpfx)check-textrel.out $(objpfx)check-execstack.out \
405                  $(objpfx)check-localplt.out $(objpfx)check-initfini.out
406 endif
407
408 ifeq ($(run-built-tests),yes)
409 tests-special += $(objpfx)order-cmp.out $(objpfx)tst-array1-cmp.out \
410                  $(objpfx)tst-array1-static-cmp.out \
411                  $(objpfx)tst-array2-cmp.out $(objpfx)tst-array3-cmp.out \
412                  $(objpfx)tst-array4-cmp.out $(objpfx)tst-array5-cmp.out \
413                  $(objpfx)tst-array5-static-cmp.out $(objpfx)order2-cmp.out \
414                  $(objpfx)tst-initorder-cmp.out \
415                  $(objpfx)tst-initorder2-cmp.out $(objpfx)tst-unused-dep.out \
416                  $(objpfx)tst-unused-dep-cmp.out
417 endif
418
419 check-abi: $(objpfx)check-abi-ld.out
420 tests-special += $(objpfx)check-abi-ld.out
421 update-abi: update-abi-ld
422 update-all-abi: update-all-abi-ld
423
424 ifeq ($(have-glob-dat-reloc),yes)
425 tests += tst-prelink
426 # Don't compile tst-prelink.c with PIE for GLOB_DAT relocation.
427 CFLAGS-tst-prelink.c += -fno-pie
428 tst-prelink-no-pie = yes
429 ifeq ($(run-built-tests),yes)
430 tests-special += $(objpfx)tst-prelink-cmp.out
431 endif
432 endif
433
434 # The test requires shared _and_ PIE because the executable
435 # unit test driver must be able to link with the shared object
436 # that is going to eventually go into an installed DSO.
437 ifeq (yesyes,$(have-fpie)$(build-shared))
438 tests-internal += tst-_dl_addr_inside_object
439 tests-pie += tst-_dl_addr_inside_object
440 $(objpfx)tst-_dl_addr_inside_object: $(objpfx)dl-addr-obj.os
441 CFLAGS-tst-_dl_addr_inside_object.c += $(PIE-ccflag)
442 endif
443
444 # We can only test static libcrypt use if libcrypt has been built,
445 # and either NSS crypto is not in use, or static NSS libraries are
446 # available.
447 ifeq ($(build-crypt),no)
448 CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=0
449 else
450 ifeq ($(nss-crypt),no)
451 CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=1
452 else
453 ifeq ($(static-nss-crypt),no)
454 CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=0
455 else
456 CFLAGS-tst-linkall-static.c += -DUSE_CRYPT=1
457 endif
458 endif
459 endif
460
461 include ../Rules
462
463 ifeq (yes,$(build-shared))
464 # Make sure these things are built in the `make lib' pass so they can be used
465 # to run programs during the `make others' pass.
466 lib-noranlib: $(objpfx)$(rtld-installed-name) \
467               $(addprefix $(objpfx),$(extra-objs))
468 endif
469
470 # Command to link into a larger single relocatable object.
471 reloc-link = $(LINK.o) -nostdlib -nostartfiles -r
472
473 $(objpfx)sotruss-lib.so: $(shlib-lds)
474
475 $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os)
476         $(reloc-link) -o $@ $^
477
478 # Link together the dynamic linker into a single relocatable object.
479 # First we do a link against libc_pic.a just to get a link map,
480 # and discard the object produced by that link.  From the link map
481 # we can glean all the libc modules that need to go into the dynamic
482 # linker.  Then we do a recursive make that goes into all the subdirs
483 # those modules come from and builds special rtld-foo.os versions that
484 # are compiled with special flags, and puts these modules into rtld-libc.a
485 # for us.  Then we do the real link using rtld-libc.a instead of libc_pic.a.
486
487 # If the compiler can do SSP, build the mapfile with dummy __stack_chk_fail
488 # and __stack_chk_fail_local symbols defined, to prevent the real things
489 # being dragged into rtld even though rtld is never built with stack-
490 # protection.
491
492 ifeq ($(have-ssp),yes)
493 dummy-stack-chk-fail := -Wl,--defsym='__stack_chk_fail=0' \
494                         -Wl,--defsym='__stack_chk_fail_local=0'
495 else
496 dummy-stack-chk-fail :=
497 endif
498
499 $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
500         @-rm -f $@T
501         $(reloc-link) -o $@.o $(dummy-stack-chk-fail) \
502                 '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T
503         rm -f $@.o
504         mv -f $@T $@
505
506 $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile
507         LC_ALL=C \
508         sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
509             $< | \
510         while read lib file; do \
511           case $$lib in \
512           libc_pic.a) \
513             LC_ALL=C fgrep -l /$$file \
514                   $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \
515             LC_ALL=C \
516             sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
517             ;; \
518           */*.a) \
519             echo rtld-$${lib%%/*} += $$file ;; \
520           *) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \
521           esac; \
522         done > $@T
523         echo rtld-subdirs = `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
524                              | LC_ALL=C sort -u` >> $@T
525         mv -f $@T $@
526
527 $(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE
528         $(MAKE) -f $< -f rtld-Rules
529
530 $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a
531         $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' \
532                   -Wl,-Map,$@.map
533
534 generated += librtld.map librtld.mk rtld-libc.a librtld.os.map
535
536 z-now-yes = -Wl,-z,now
537
538 $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
539 # Link into a temporary file so that we don't touch $@ at all
540 # if the sanity check below fails.
541         $(LINK.o) -nostdlib -nostartfiles -shared -o $@.new             \
542                   $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now))      \
543                   $(filter-out $(map-file),$^) $(load-map-file)         \
544                   -Wl,-soname=$(rtld-installed-name)                    \
545                   -Wl,-defsym=_begin=0
546         $(call after-link,$@.new)
547         $(READELF) -s $@.new \
548           | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
549         mv -f $@.new $@
550
551 ifeq (yes,$(build-shared))
552 # interp.c exists just to get the runtime linker path into libc.so.
553 $(objpfx)interp.os: $(common-objpfx)runtime-linker.h
554 endif
555
556 ifneq (ld.so,$(rtld-installed-name))
557 # Make sure ld.so.1 exists in the build directory so we can link
558 # against it.
559 $(objpfx)$(rtld-installed-name): $(objpfx)ld.so
560         $(make-link)
561 generated += $(rtld-installed-name)
562 endif
563
564 # Build a file mentioning all trustworthy directories to look for shared
565 # libraries when using LD_LIBRARY_PATH in a setuid program.  The user can
566 # add directories to the list by defining $(user-defined-trusted-dirs)
567 # before starting make.
568 $(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @:
569 $(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig
570         $(make-target-directory)
571         echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))"    \
572         | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T};
573         echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T}
574         $(move-if-change) ${@:st=T} ${@:st=h}
575         touch $@
576 CPPFLAGS-dl-load.c += -I$(objpfx). -I$(csu-objpfx).
577
578 ifeq (yes,$(build-shared))
579 $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force)
580         $(make-target-directory)
581         $(do-install-program)
582
583 $(inst_rtlddir)/$(rtld-installed-name): \
584   $(inst_slibdir)/$(rtld-version-installed-name) \
585   $(inst_slibdir)/libc-$(version).so
586         $(make-target-directory)
587         $(make-shlib-link)
588
589 # Special target called by parent to install just the dynamic linker.
590 .PHONY: ldso_install
591 ldso_install: $(inst_rtlddir)/$(rtld-installed-name)
592 endif
593
594
595 ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
596               -e 's%@VERSION@%$(version)%g' \
597               -e 's|@PKGVERSION@|$(PKGVERSION)|g' \
598               -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
599               -e 's%@BASH@%$(BASH)%g' \
600               -e 's%@TEXTDOMAINDIR@%$(localedir)%g'
601
602 ifeq ($(ldd-rewrite-script),no)
603 define gen-ldd
604 LC_ALL=C sed $(ldd-rewrite) < $< > $@.new
605 endef
606 else
607 define gen-ldd
608 LC_ALL=C sed $(ldd-rewrite) < $< \
609 | LC_ALL=C sed -f $(patsubst $(..)/%,/%,$(..)$(ldd-rewrite-script)) > $@.new
610 endef
611 endif
612
613 $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \
614               $(common-objpfx)config.make
615         $(gen-ldd)
616         chmod 555 $@.new
617         mv -f $@.new $@
618
619 $(objpfx)sprof: $(libdl)
620
621 $(objpfx)sln: $(sln-modules:%=$(objpfx)%.o)
622
623 $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
624
625 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
626 CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
627                     -D'SLIBDIR="$(slibdir)"'
628 libof-ldconfig = ldconfig
629 CFLAGS-dl-cache.c += $(SYSCONF-FLAGS)
630 CFLAGS-cache.c += $(SYSCONF-FLAGS)
631 CFLAGS-rtld.c += $(SYSCONF-FLAGS)
632
633 cpp-srcs-left := $(all-rtld-routines:=.os)
634 lib := rtld
635 include $(patsubst %,$(..)libof-iterator.mk,$(cpp-srcs-left))
636
637 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
638 generated += $(addsuffix .so,$(strip $(modules-names)))
639
640 $(objpfx)testobj1.so: $(libdl)
641 $(objpfx)testobj1_1.so: $(objpfx)testobj1.so $(libdl)
642 $(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl)
643 $(objpfx)testobj3.so: $(libdl)
644 $(objpfx)testobj4.so: $(libdl)
645 $(objpfx)testobj5.so: $(libdl)
646 $(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so $(libdl)
647 $(objpfx)failobj.so: $(objpfx)testobj6.so
648 $(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so
649 $(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so
650 $(objpfx)dep4.so: $(objpfx)dep3.so
651 $(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so
652 $(objpfx)nextmod1.so: $(libdl)
653 $(objpfx)neededobj1.so: $(libdl)
654 $(objpfx)neededobj2.so: $(objpfx)neededobj1.so $(libdl)
655 $(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so $(libdl)
656 $(objpfx)neededobj4.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
657                         $(objpfx)neededobj3.so $(libdl)
658 $(objpfx)neededobj6.so: $(objpfx)neededobj5.so
659 $(objpfx)unload2mod.so: $(objpfx)unload2dep.so
660 $(objpfx)ltglobmod2.so: $(libdl)
661 $(objpfx)firstobj.so: $(shared-thread-library)
662 $(objpfx)globalmod1.so: $(libdl)
663 $(objpfx)reldep4mod1.so: $(objpfx)reldep4mod3.so
664 $(objpfx)reldep4mod2.so: $(objpfx)reldep4mod4.so
665 $(objpfx)dblloadmod1.so: $(objpfx)dblloadmod3.so
666 $(objpfx)dblloadmod2.so: $(objpfx)dblloadmod3.so
667 $(objpfx)reldepmod5.so: $(objpfx)reldepmod2.so
668 $(objpfx)reldepmod6.so: $(objpfx)reldepmod2.so
669 $(objpfx)reldep6mod1.so: $(objpfx)reldep6mod0.so
670 $(objpfx)reldep6mod2.so: $(objpfx)reldep6mod1.so
671 $(objpfx)reldep6mod3.so: $(objpfx)reldep6mod2.so
672 $(objpfx)reldep6mod4.so: $(objpfx)reldep6mod1.so
673 $(objpfx)tst-tlsmod3.so: $(objpfx)tst-tlsmod2.so
674 $(objpfx)tst-tlsmod8.so: $(objpfx)tst-tlsmod7.so
675 $(objpfx)tst-tlsmod10.so: $(objpfx)tst-tlsmod9.so
676 $(objpfx)tst-tlsmod12.so: $(objpfx)tst-tlsmod11.so
677 $(objpfx)tst-tlsmod13a.so: $(objpfx)tst-tlsmod13.so
678 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
679 $(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so
680 $(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so
681 $(objpfx)tst-tls19mod1.so: $(objpfx)tst-tls19mod2.so $(objpfx)tst-tls19mod3.so
682 $(objpfx)tst-tls19mod3.so: $(objpfx)ld.so
683 $(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so
684 $(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so
685 $(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so
686 $(objpfx)reldep9mod3.so: $(objpfx)reldep9mod1.so $(objpfx)reldep9mod2.so
687 $(objpfx)unload3mod1.so: $(objpfx)unload3mod3.so
688 $(objpfx)unload3mod2.so: $(objpfx)unload3mod3.so
689 $(objpfx)unload3mod3.so: $(objpfx)unload3mod4.so
690 $(objpfx)unload4mod1.so: $(objpfx)unload4mod2.so $(objpfx)unload4mod3.so
691 $(objpfx)unload4mod2.so: $(objpfx)unload4mod4.so $(objpfx)unload4mod3.so
692 $(objpfx)unload6mod1.so: $(libdl)
693 $(objpfx)unload6mod2.so: $(libdl)
694 $(objpfx)unload6mod3.so: $(libdl)
695 $(objpfx)unload7mod1.so: $(libdl)
696 $(objpfx)unload7mod2.so: $(objpfx)unload7mod1.so
697 $(objpfx)unload8mod1.so: $(objpfx)unload8mod2.so
698 $(objpfx)unload8mod2.so: $(objpfx)unload8mod3.so
699 $(objpfx)unload8mod3.so: $(libdl)
700 $(objpfx)tst-initordera2.so: $(objpfx)tst-initordera1.so
701 $(objpfx)tst-initorderb2.so: $(objpfx)tst-initorderb1.so $(objpfx)tst-initordera2.so
702 $(objpfx)tst-initordera3.so: $(objpfx)tst-initorderb2.so $(objpfx)tst-initorderb1.so
703 $(objpfx)tst-initordera4.so: $(objpfx)tst-initordera3.so
704 $(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so $(objpfx)tst-initorderb2.so
705 $(objpfx)tst-null-argv: $(objpfx)tst-null-argv-lib.so
706 $(objpfx)tst-tlsalign: $(objpfx)tst-tlsalign-lib.so
707 $(objpfx)tst-nodelete-opened.out: $(objpfx)tst-nodelete-opened-lib.so
708 $(objpfx)tst-nodelete-opened: $(libdl)
709 $(objpfx)tst-noload: $(libdl)
710
711 $(objpfx)tst-tlsalign-extern: $(objpfx)tst-tlsalign-vars.o
712 $(objpfx)tst-tlsalign-extern-static: $(objpfx)tst-tlsalign-vars.o
713
714 tst-null-argv-ENV = LD_DEBUG=all LD_DEBUG_OUTPUT=$(objpfx)tst-null-argv.debug.out
715 LDFLAGS-nodel2mod3.so = -Wl,--no-as-needed
716 LDFLAGS-reldepmod5.so = -Wl,--no-as-needed
717 LDFLAGS-reldep6mod1.so = -Wl,--no-as-needed
718 LDFLAGS-reldep6mod4.so = -Wl,--no-as-needed
719 LDFLAGS-reldep8mod3.so = -Wl,--no-as-needed
720 LDFLAGS-unload4mod1.so = -Wl,--no-as-needed
721 LDFLAGS-unload4mod2.so = -Wl,--no-as-needed
722 LDFLAGS-tst-initorder = -Wl,--no-as-needed
723 LDFLAGS-tst-initordera2.so = -Wl,--no-as-needed
724 LDFLAGS-tst-initordera3.so = -Wl,--no-as-needed
725 LDFLAGS-tst-initordera4.so = -Wl,--no-as-needed
726 LDFLAGS-tst-initorderb2.so = -Wl,--no-as-needed
727 LDFLAGS-tst-tlsmod5.so = -nostdlib -Wl,--no-as-needed
728 LDFLAGS-tst-tlsmod6.so = -nostdlib -Wl,--no-as-needed
729
730 testobj1.so-no-z-defs = yes
731 testobj3.so-no-z-defs = yes
732 testobj4.so-no-z-defs = yes
733 testobj5.so-no-z-defs = yes
734 testobj6.so-no-z-defs = yes
735 failobj.so-no-z-defs = yes
736 constload2.so-no-z-defs = yes
737 constload3.so-no-z-defs = yes
738 nodelmod1.so-no-z-defs = yes
739 nodelmod2.so-no-z-defs = yes
740 nodelmod4.so-no-z-defs = yes
741 nodel2mod2.so-no-z-defs = yes
742 reldepmod2.so-no-z-defs = yes
743 reldepmod3.so-no-z-defs = yes
744 reldepmod4.so-no-z-defs = yes
745 reldep4mod4.so-no-z-defs = yes
746 reldep4mod2.so-no-z-defs = yes
747 ltglobmod2.so-no-z-defs = yes
748 dblloadmod3.so-no-z-defs = yes
749 tst-tlsmod1.so-no-z-defs = yes
750 tst-tlsmod2.so-no-z-defs = yes
751 tst-tlsmod3.so-no-z-defs = yes
752 tst-tlsmod4.so-no-z-defs = yes
753 tst-tlsmod7.so-no-z-defs = yes
754 tst-tlsmod8.so-no-z-defs = yes
755 tst-tlsmod9.so-no-z-defs = yes
756 tst-tlsmod10.so-no-z-defs = yes
757 tst-tlsmod12.so-no-z-defs = yes
758 tst-tlsmod14a.so-no-z-defs = yes
759 tst-tlsmod14b.so-no-z-defs = yes
760 tst-tlsmod15a.so-no-z-defs = yes
761 tst-tlsmod16b.so-no-z-defs = yes
762 circlemod2.so-no-z-defs = yes
763 circlemod3.so-no-z-defs = yes
764 circlemod3a.so-no-z-defs = yes
765 reldep8mod2.so-no-z-defs = yes
766 reldep9mod1.so-no-z-defs = yes
767 unload3mod4.so-no-z-defs = yes
768 unload4mod1.so-no-z-defs = yes
769 ifuncmod1.so-no-z-defs = yes
770 ifuncmod5.so-no-z-defs = yes
771 ifuncmod6.so-no-z-defs = yes
772 tst-auditmod9a.so-no-z-defs = yes
773 tst-auditmod9b.so-no-z-defs = yes
774 tst-nodelete-uniquemod.so-no-z-defs = yes
775 tst-nodelete-rtldmod.so-no-z-defs = yes
776 tst-nodelete-zmod.so-no-z-defs = yes
777 tst-nodelete2mod.so-no-z-defs = yes
778
779 ifeq ($(build-shared),yes)
780 # Build all the modules even when not actually running test programs.
781 tests: $(test-modules)
782 endif
783
784 $(objpfx)loadtest: $(libdl)
785 LDFLAGS-loadtest = -rdynamic
786
787 $(objpfx)loadtest.out: $(test-modules)
788
789 $(objpfx)neededtest: $(libdl)
790 $(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
791                          $(objpfx)neededobj3.so
792
793 $(objpfx)neededtest2: $(libdl)
794 $(objpfx)neededtest2.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
795                           $(objpfx)neededobj3.so
796
797 $(objpfx)neededtest3: $(libdl)
798 $(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
799                           $(objpfx)neededobj3.so $(objpfx)neededobj4.so
800
801 $(objpfx)neededtest4: $(libdl) $(objpfx)neededobj1.so
802 $(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so
803
804 $(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so $(libdl)
805 LDFLAGS-restest1 = -rdynamic
806
807 $(objpfx)restest2: $(libdl)
808 LDFLAGS-restest2 = -rdynamic
809
810 $(objpfx)restest1.out: $(test-modules)
811
812 preloadtest-preloads = testobj1 testobj2 testobj3 testobj4 testobj5
813 $(objpfx)preloadtest: $(objpfx)testobj6.so
814 LDFLAGS-preloadtest = -rdynamic
815 $(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so)
816 preloadtest-ENV = \
817   LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so)))
818
819 $(objpfx)loadfail: $(libdl)
820 LDFLAGS-loadfail = -rdynamic
821
822 $(objpfx)loadfail.out: $(objpfx)failobj.so
823
824 $(objpfx)multiload: $(libdl)
825 LDFLAGS-multiload = -rdynamic
826 CFLAGS-multiload.c += -DOBJDIR=\"$(elf-objpfx)\"
827
828 $(objpfx)multiload.out: $(objpfx)testobj1.so
829
830 $(objpfx)origtest: $(libdl)
831 LDFLAGS-origtest = -rdynamic
832 $(objpfx)origtest.out: $(objpfx)testobj1.so
833
834 ifeq ($(have-thread-library),yes)
835 $(objpfx)resolvfail: $(libdl) $(shared-thread-library)
836 else
837 $(objpfx)resolvfail: $(libdl)
838 endif
839
840 $(objpfx)constload1: $(libdl)
841 $(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so
842
843 $(objpfx)circleload1: $(libdl)
844 $(objpfx)circleload1.out: $(objpfx)circlemod1.so \
845                           $(objpfx)circlemod1a.so
846
847 $(objpfx)circlemod1.so: $(objpfx)circlemod2.so
848 $(objpfx)circlemod2.so: $(objpfx)circlemod3.so
849 $(objpfx)circlemod1a.so: $(objpfx)circlemod2a.so
850 $(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so
851
852 $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so)
853
854 $(objpfx)order-cmp.out: $(objpfx)order.out
855         (echo "0123456789" | cmp $< -) > $@; \
856         $(evaluate-test)
857
858 $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so)
859 $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so)
860 vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so)
861
862 $(objpfx)noload: $(objpfx)testobj1.so $(libdl)
863 LDFLAGS-noload = -rdynamic -Wl,--no-as-needed
864 $(objpfx)noload.out: $(objpfx)testobj5.so
865
866 $(objpfx)noload-mem.out: $(objpfx)noload.out
867         $(common-objpfx)malloc/mtrace $(objpfx)noload.mtrace > $@; \
868         $(evaluate-test)
869 noload-ENV = MALLOC_TRACE=$(objpfx)noload.mtrace
870
871 LDFLAGS-nodelete = -rdynamic
872 LDFLAGS-nodelmod1.so = -Wl,--enable-new-dtags,-z,nodelete
873 LDFLAGS-nodelmod4.so = -Wl,--enable-new-dtags,-z,nodelete
874 $(objpfx)nodelete: $(libdl)
875 $(objpfx)nodelete.out: $(objpfx)nodelmod1.so $(objpfx)nodelmod2.so \
876                        $(objpfx)nodelmod3.so
877
878 LDFLAGS-nodlopenmod.so = -Wl,--enable-new-dtags,-z,nodlopen
879 $(objpfx)nodlopen: $(libdl)
880 $(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so
881
882 $(objpfx)nodlopenmod2.so: $(objpfx)nodlopenmod.so
883 $(objpfx)nodlopen2: $(libdl)
884 $(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so
885
886 $(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so
887         $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \
888                   -L$(subst :, -L,$(rpath-link)) \
889                   -Wl,-rpath-link=$(rpath-link) \
890                   $< -Wl,-F,$(objpfx)filtmod2.so
891 $(objpfx)filter: $(objpfx)filtmod1.so
892
893 # This does not link against libc.
894 CFLAGS-filtmod1.c += $(no-stack-protector)
895
896 $(objpfx)unload: $(libdl)
897 $(objpfx)unload.out: $(objpfx)unloadmod.so
898
899 $(objpfx)reldep: $(libdl)
900 $(objpfx)reldep.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod2.so
901
902 $(objpfx)reldep2: $(libdl)
903 $(objpfx)reldep2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so
904
905 $(objpfx)reldep3: $(libdl)
906 $(objpfx)reldep3.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so
907
908 $(objpfx)reldep4: $(libdl)
909 $(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so
910
911 $(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so $(libdl)
912 LDFLAGS-next = -Wl,--no-as-needed
913
914 $(objpfx)unload2: $(libdl)
915 $(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so
916
917 $(objpfx)lateglobal: $(libdl)
918 $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so
919
920 $(objpfx)tst-pathopt: $(libdl)
921 $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
922                           $(objpfx)pathoptobj.so
923         $(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' \
924                  '$(run-program-env)' > $@; \
925         $(evaluate-test)
926
927 $(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so
928         $(SHELL) $^ '$(test-wrapper)' '$(test-wrapper-env)' > $@; \
929         $(evaluate-test)
930
931 tst-rtld-preload-OBJS = $(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so)))
932 $(objpfx)tst-rtld-preload.out: tst-rtld-preload.sh $(objpfx)ld.so \
933                                $(objpfx)preloadtest \
934                                $(preloadtest-preloads:%=$(objpfx)%.so)
935         $(SHELL) $< $(objpfx)ld.so $(objpfx)preloadtest \
936                     '$(test-wrapper-env)' '$(run_program_env)' \
937                     '$(rpath-link)' '$(tst-rtld-preload-OBJS)' > $@; \
938         $(evaluate-test)
939
940 $(objpfx)initfirst: $(libdl)
941 $(objpfx)initfirst.out: $(objpfx)firstobj.so
942
943 $(objpfx)global: $(objpfx)globalmod1.so
944 $(objpfx)global.out: $(objpfx)reldepmod1.so
945
946 $(objpfx)dblload: $(libdl)
947 $(objpfx)dblload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so
948
949 $(objpfx)dblunload: $(libdl)
950 $(objpfx)dblunload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so
951
952 $(objpfx)reldep5: $(libdl)
953 $(objpfx)reldep5.out: $(objpfx)reldepmod5.so $(objpfx)reldepmod6.so
954
955 $(objpfx)reldep6: $(libdl)
956 $(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so
957
958 $(objpfx)reldep7: $(libdl)
959 $(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so
960
961 $(objpfx)reldep8: $(libdl)
962 $(objpfx)reldep8.out: $(objpfx)reldep8mod3.so
963
964 LDFLAGS-nodel2mod2.so = -Wl,--enable-new-dtags,-z,nodelete
965 $(objpfx)nodelete2: $(libdl)
966 $(objpfx)nodelete2.out: $(objpfx)nodel2mod3.so
967
968 $(objpfx)reldep9: $(libdl)
969 $(objpfx)reldep9.out: $(objpfx)reldep9mod3.so
970
971 $(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so
972
973 $(objpfx)tst-tls4: $(libdl)
974 $(objpfx)tst-tls4.out: $(objpfx)tst-tlsmod2.so
975
976 $(objpfx)tst-tls5: $(libdl)
977 $(objpfx)tst-tls5.out: $(objpfx)tst-tlsmod2.so
978
979 $(objpfx)tst-tls6: $(libdl)
980 $(objpfx)tst-tls6.out: $(objpfx)tst-tlsmod2.so
981
982 $(objpfx)tst-tls7: $(libdl)
983 $(objpfx)tst-tls7.out: $(objpfx)tst-tlsmod3.so
984
985 $(objpfx)tst-tls8: $(libdl)
986 $(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so
987
988 $(objpfx)tst-tls9: $(libdl)
989 $(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
990
991 $(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so $(objpfx)tst-tlsmod7.so
992
993 $(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so $(objpfx)tst-tlsmod9.so
994
995 $(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so $(objpfx)tst-tlsmod11.so
996
997 $(objpfx)tst-tls13: $(libdl)
998 $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so
999
1000 $(objpfx)tst-tls14: $(objpfx)tst-tlsmod14a.so $(libdl)
1001 $(objpfx)tst-tls14.out: $(objpfx)tst-tlsmod14b.so
1002
1003 $(objpfx)tst-tls15: $(libdl)
1004 $(objpfx)tst-tls15.out: $(objpfx)tst-tlsmod15a.so $(objpfx)tst-tlsmod15b.so
1005
1006 $(objpfx)tst-tls-dlinfo: $(libdl)
1007 $(objpfx)tst-tls-dlinfo.out: $(objpfx)tst-tlsmod2.so
1008
1009
1010
1011 $(objpfx)tst-tls16: $(libdl)
1012 $(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so
1013
1014 $(objpfx)tst-tls17: $(libdl)
1015 $(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so
1016 $(patsubst %,$(objpfx)%.os,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.os: tst-tlsmod17a.c
1017         $(compile-command.c) -DN=$*
1018 $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so
1019 $(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules))
1020
1021 $(objpfx)tst-tls18: $(libdl)
1022 $(objpfx)tst-tls18.out: $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules))
1023 $(patsubst %,$(objpfx)%.os,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.os : tst-tlsmod18a.c
1024         $(compile-command.c) -DN=$*
1025 $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so
1026
1027 $(objpfx)tst-tls19: $(libdl)
1028 $(objpfx)tst-tls19.out: $(objpfx)tst-tls19mod1.so
1029
1030 CFLAGS-tst-align.c += $(stack-align-test-flags)
1031 CFLAGS-tst-align2.c += $(stack-align-test-flags)
1032 CFLAGS-tst-alignmod.c += $(stack-align-test-flags)
1033 CFLAGS-tst-alignmod2.c += $(stack-align-test-flags)
1034 $(objpfx)tst-align: $(libdl)
1035 $(objpfx)tst-align.out: $(objpfx)tst-alignmod.so
1036 $(objpfx)tst-align2: $(objpfx)tst-alignmod2.so
1037
1038 $(objpfx)unload3: $(libdl)
1039 $(objpfx)unload3.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \
1040                       $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so
1041
1042 $(objpfx)unload4: $(libdl)
1043 $(objpfx)unload4.out: $(objpfx)unload4mod1.so $(objpfx)unload4mod3.so
1044
1045 $(objpfx)unload5: $(libdl)
1046 $(objpfx)unload5.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \
1047                       $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so
1048
1049 $(objpfx)unload6: $(libdl)
1050 $(objpfx)unload6.out: $(objpfx)unload6mod1.so $(objpfx)unload6mod2.so \
1051                       $(objpfx)unload6mod3.so
1052
1053 $(objpfx)unload7: $(libdl)
1054 $(objpfx)unload7.out: $(objpfx)unload7mod1.so $(objpfx)unload7mod2.so
1055 unload7-ENV = MALLOC_PERTURB_=85
1056
1057 $(objpfx)unload8: $(libdl)
1058 $(objpfx)unload8.out: $(objpfx)unload8mod1.so $(objpfx)unload8mod1x.so
1059
1060 ifdef libdl
1061 $(objpfx)tst-tls9-static: $(common-objpfx)dlfcn/libdl.a
1062 $(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
1063 endif
1064
1065 ifeq ($(have-z-execstack),yes)
1066 $(objpfx)tst-execstack: $(libdl)
1067 $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
1068 CPPFLAGS-tst-execstack.c += -DUSE_PTHREADS=0
1069 LDFLAGS-tst-execstack = -Wl,-z,noexecstack
1070 LDFLAGS-tst-execstack-mod.so = -Wl,-z,execstack
1071
1072 $(objpfx)tst-execstack-needed: $(objpfx)tst-execstack-mod.so
1073 LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack
1074
1075 LDFLAGS-tst-execstack-prog = -Wl,-z,execstack
1076 CFLAGS-tst-execstack-prog.c += -Wno-trampolines
1077 CFLAGS-tst-execstack-mod.c += -Wno-trampolines
1078 endif
1079
1080 LDFLAGS-tst-array2 = -Wl,--no-as-needed
1081 LDFLAGS-tst-array5 = -Wl,--no-as-needed
1082
1083 $(objpfx)tst-array1-cmp.out: tst-array1.exp $(objpfx)tst-array1.out
1084         cmp $^ > $@; \
1085         $(evaluate-test)
1086
1087 $(objpfx)tst-array1-static-cmp.out: tst-array1.exp \
1088                                     $(objpfx)tst-array1-static.out
1089         cmp $^ > $@; \
1090         $(evaluate-test)
1091
1092 $(objpfx)tst-array2: $(objpfx)tst-array2dep.so
1093 $(objpfx)tst-array2-cmp.out: tst-array2.exp $(objpfx)tst-array2.out
1094         cmp $^ > $@; \
1095         $(evaluate-test)
1096
1097 $(objpfx)tst-array3-cmp.out: tst-array1.exp $(objpfx)tst-array3.out
1098         cmp $^ > $@; \
1099         $(evaluate-test)
1100
1101 $(objpfx)tst-array4: $(libdl)
1102 $(objpfx)tst-array4.out: $(objpfx)tst-array2dep.so
1103 $(objpfx)tst-array4-cmp.out: tst-array4.exp $(objpfx)tst-array4.out
1104         cmp $^ > $@; \
1105         $(evaluate-test)
1106
1107 $(objpfx)tst-array5: $(objpfx)tst-array5dep.so
1108 $(objpfx)tst-array5-cmp.out: tst-array5.exp $(objpfx)tst-array5.out
1109         cmp $^ > $@; \
1110         $(evaluate-test)
1111
1112 $(objpfx)tst-array5-static-cmp.out: tst-array5-static.exp \
1113                                 $(objpfx)tst-array5-static.out
1114         cmp $^ > $@; \
1115         $(evaluate-test)
1116
1117 CFLAGS-tst-pie1.c += $(pie-ccflag)
1118 CFLAGS-tst-pie2.c += $(pie-ccflag)
1119
1120 $(objpfx)tst-piemod1.so: $(libsupport)
1121 $(objpfx)tst-pie1: $(objpfx)tst-piemod1.so
1122 $(objpfx)tst-dlopen-pie: $(libdl)
1123 $(objpfx)tst-dlopen-pie.out: $(objpfx)tst-pie1
1124
1125 ifeq (yes,$(build-shared))
1126 # NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with
1127 # all-built-dso here.
1128 all-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
1129                  $(filter-out $(common-objpfx)linkobj/libc.so, \
1130                               $(sort $(wildcard $(addprefix $(common-objpfx), \
1131                                                             */lib*.so \
1132                                                             iconvdata/*.so))))
1133
1134 $(all-built-dso:=.dyn): %.dyn: %
1135         @rm -f $@T
1136         LC_ALL=C $(READELF) -W -d $< > $@T
1137         test -s $@T
1138         mv -f $@T $@
1139 common-generated += $(all-built-dso:$(common-objpfx)%=%.dyn)
1140
1141 $(objpfx)check-textrel.out: $(..)scripts/check-textrel.awk \
1142                             $(all-built-dso:=.dyn)
1143         LC_ALL=C $(AWK) -f $^ > $@; \
1144         $(evaluate-test)
1145 generated += check-textrel.out
1146
1147 $(objpfx)execstack-default: $(first-word $(wildcard $(sysdirs:%=%/stackinfo.h)))
1148         $(make-target-directory)
1149         { echo '#include <elf.h>'; \
1150           echo '#include <stackinfo.h>'; \
1151           echo '#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
1152           echo '@@@execstack-no@@@'; \
1153           echo '#else'; \
1154           echo '@@@execstack-yes@@@'; \
1155           echo '#endif'; } | \
1156         $(CC) $(CFLAGS) $(CPPFLAGS) -E -x c-header - | \
1157         sed -n -e 's/^@@@\(.*\)@@@/\1/p' > $@T
1158         mv -f $@T $@
1159 generated += execstack-default
1160
1161 $(all-built-dso:=.phdr): %.phdr: %
1162         @rm -f $@T
1163         LC_ALL=C $(READELF) -W -l $< > $@T
1164         test -s $@T
1165         mv -f $@T $@
1166 common-generated += $(all-built-dso:$(common-objpfx)%=%.phdr)
1167
1168 $(objpfx)check-execstack.out: $(..)scripts/check-execstack.awk \
1169                               $(objpfx)execstack-default \
1170                               $(all-built-dso:=.phdr)
1171         LC_ALL=C $(AWK) -v "xfail=$(check-execstack-xfail)" -f $^ > $@; \
1172         $(evaluate-test)
1173 generated += check-execstack.out
1174
1175 $(objpfx)tst-dlmodcount: $(libdl)
1176 $(objpfx)tst-dlmodcount.out: $(test-modules)
1177
1178 $(all-built-dso:=.jmprel): %.jmprel: % Makefile
1179         @rm -f $@T
1180         LC_ALL=C $(READELF) -W -S -d -r $< > $@T
1181         test -s $@T
1182         mv -f $@T $@
1183 common-generated += $(all-built-dso:$(common-objpfx)%=%.jmprel)
1184
1185 localplt-built-dso := $(addprefix $(common-objpfx),\
1186                                   libc.so \
1187                                   elf/ld.so \
1188                                   math/libm.so \
1189                                   rt/librt.so \
1190                                   dlfcn/libdl.so \
1191                                   resolv/libresolv.so \
1192                        )
1193 ifeq ($(build-mathvec),yes)
1194 localplt-built-dso += $(addprefix $(common-objpfx), mathvec/libmvec.so)
1195 endif
1196 ifeq ($(have-thread-library),yes)
1197 localplt-built-dso += $(filter-out %_nonshared.a, $(shared-thread-library))
1198 endif
1199 ifeq ($(build-crypt),yes)
1200 localplt-built-dso += $(addprefix $(common-objpfx), crypt/libcrypt.so)
1201 endif
1202
1203 vpath localplt.data $(+sysdep_dirs)
1204
1205 $(objpfx)check-localplt.out: $(..)scripts/check-localplt.awk \
1206                              $(..)scripts/localplt.awk \
1207                              $(localplt-built-dso:=.jmprel) \
1208                              localplt.data
1209         LC_ALL=C $(AWK) -f $(filter-out $< %localplt.data,$^) | \
1210           LC_ALL=C $(AWK) -f $< $(filter %localplt.data,$^) - \
1211           > $@; \
1212         $(evaluate-test)
1213 endif
1214
1215 $(all-built-dso:=.dynsym): %.dynsym: %
1216         @rm -f $@T
1217         LC_ALL=C $(READELF) -W --dyn-syms $< > $@T
1218         test -s $@T
1219         mv -f $@T $@
1220 common-generated += $(all-built-dso:$(common-objpfx)%=%.dynsym)
1221
1222 $(objpfx)check-initfini.out: $(..)scripts/check-initfini.awk \
1223                             $(all-built-dso:=.dynsym)
1224         LC_ALL=C $(AWK) -f $^ > $@; \
1225         $(evaluate-test)
1226 generated += check-initfini.out
1227
1228 $(objpfx)tst-dlopenrpathmod.so: $(libdl)
1229 $(objpfx)tst-dlopenrpath: $(objpfx)tst-dlopenrpathmod.so $(libdl)
1230 CFLAGS-tst-dlopenrpath.c += -DPFX=\"$(objpfx)\"
1231 LDFLAGS-tst-dlopenrpathmod.so += -Wl,-rpath,\$$ORIGIN/test-subdir
1232 $(objpfx)tst-dlopenrpath.out: $(objpfx)firstobj.so
1233
1234 $(objpfx)tst-deep1mod2.so: $(objpfx)tst-deep1mod3.so
1235 $(objpfx)tst-deep1: $(libdl) $(objpfx)tst-deep1mod1.so
1236 $(objpfx)tst-deep1.out: $(objpfx)tst-deep1mod2.so
1237 LDFLAGS-tst-deep1 += -rdynamic
1238 tst-deep1mod3.so-no-z-defs = yes
1239
1240 $(objpfx)tst-dlmopen1mod.so: $(libdl)
1241 $(objpfx)tst-dlmopen1: $(libdl)
1242 $(objpfx)tst-dlmopen1.out: $(objpfx)tst-dlmopen1mod.so
1243
1244 $(objpfx)tst-dlmopen2: $(libdl)
1245 $(objpfx)tst-dlmopen2.out: $(objpfx)tst-dlmopen1mod.so
1246
1247 $(objpfx)tst-dlmopen3: $(libdl)
1248 $(objpfx)tst-dlmopen3.out: $(objpfx)tst-dlmopen1mod.so
1249
1250 $(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so
1251 tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
1252
1253 $(objpfx)tst-audit2: $(libdl)
1254 $(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so $(objpfx)tst-auditmod9b.so
1255 # Prevent GCC-5 from translating a malloc/memset pair into calloc
1256 CFLAGS-tst-audit2.c += -fno-builtin
1257 tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
1258
1259 $(objpfx)tst-audit9: $(libdl)
1260 $(objpfx)tst-audit9.out: $(objpfx)tst-auditmod9a.so $(objpfx)tst-auditmod9b.so
1261 tst-audit9-ENV = LD_AUDIT=$(objpfx)tst-auditmod9a.so
1262
1263 $(objpfx)tst-audit8: $(libm)
1264 $(objpfx)tst-audit8.out: $(objpfx)tst-auditmod1.so
1265 tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
1266
1267 $(objpfx)tst-global1: $(libdl)
1268 $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so
1269
1270 $(objpfx)order2: $(libdl)
1271 $(objpfx)order2.out: $(objpfx)order2mod1.so $(objpfx)order2mod2.so
1272 $(objpfx)order2-cmp.out: $(objpfx)order2.out
1273         (echo "12345" | cmp $< -) > $@; \
1274         $(evaluate-test)
1275 $(objpfx)order2mod1.so: $(objpfx)order2mod4.so
1276 $(objpfx)order2mod4.so: $(objpfx)order2mod3.so
1277 $(objpfx)order2mod2.so: $(objpfx)order2mod3.so
1278 order2mod2.so-no-z-defs = yes
1279 LDFLAGS-order2mod1.so = -Wl,--no-as-needed
1280 LDFLAGS-order2mod2.so = -Wl,--no-as-needed
1281
1282 tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child"
1283 tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
1284
1285 tst-ptrguard1-ARGS = --command "$(host-test-program-cmd) --child"
1286 # When built statically, the pointer guard interface uses
1287 # __pointer_chk_guard_local.
1288 CFLAGS-tst-ptrguard1-static.c += -DPTRGUARD_LOCAL
1289 tst-ptrguard1-static-ARGS = --command "$(objpfx)tst-ptrguard1-static --child"
1290
1291 $(objpfx)tst-leaks1: $(libdl)
1292 $(objpfx)tst-leaks1-mem.out: $(objpfx)tst-leaks1.out
1293         $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@; \
1294         $(evaluate-test)
1295
1296 $(objpfx)tst-leaks1-static: $(common-objpfx)dlfcn/libdl.a
1297 $(objpfx)tst-leaks1-static-mem.out: $(objpfx)tst-leaks1-static.out
1298         $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1-static.mtrace > $@; \
1299         $(evaluate-test)
1300
1301 tst-leaks1-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1.mtrace
1302 tst-leaks1-static-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1-static.mtrace
1303
1304 $(objpfx)tst-addr1: $(libdl)
1305
1306 $(objpfx)tst-thrlock: $(libdl) $(shared-thread-library)
1307
1308 tst-tst-dlopen-tlsmodid-no-pie = yes
1309 $(objpfx)tst-dlopen-tlsmodid: $(libdl) $(shared-thread-library)
1310 $(objpfx)tst-dlopen-tlsmodid.out: $(objpfx)tst-dlopen-self
1311 CFLAGS-tst-dlopen-tlsmodid-pie.c += $(pie-ccflag)
1312 $(objpfx)tst-dlopen-tlsmodid-pie: $(libdl) $(shared-thread-library)
1313 $(objpfx)tst-dlopen-tlsmodid-pie.out: $(objpfx)tst-dlopen-self-pie
1314 $(objpfx)tst-dlopen-tlsmodid-container: $(libdl) $(shared-thread-library)
1315 LDFLAGS-tst-dlopen-tlsmodid-container += -Wl,-rpath,\$$ORIGIN
1316
1317 tst-tst-dlopen-self-no-pie = yes
1318 $(objpfx)tst-dlopen-self: $(libdl)
1319 CFLAGS-tst-dlopen-self-pie.c += $(pie-ccflag)
1320 $(objpfx)tst-dlopen-self-pie: $(libdl)
1321 $(objpfx)tst-dlopen-self-container: $(libdl)
1322 LDFLAGS-tst-dlopen-self-container += -Wl,-rpath,\$$ORIGIN
1323
1324 CFLAGS-ifuncmain1pic.c += $(pic-ccflag)
1325 CFLAGS-ifuncmain1picstatic.c += $(pic-ccflag)
1326 CFLAGS-ifuncmain1staticpic.c += $(pic-ccflag)
1327 CFLAGS-ifuncdep1pic.c += $(pic-ccflag)
1328 CFLAGS-ifuncmain1vispic.c += $(pic-ccflag)
1329 CFLAGS-ifuncmain2pic.c += $(pic-ccflag)
1330 CFLAGS-ifuncmain2picstatic.c += $(pic-ccflag)
1331 CFLAGS-ifuncdep2pic.c += $(pic-ccflag)
1332 CFLAGS-ifuncmain4picstatic.c += $(pic-ccflag)
1333 CFLAGS-ifuncmain5pic.c += $(pic-ccflag)
1334 CFLAGS-ifuncmain5picstatic.c += $(pic-ccflag)
1335 CFLAGS-ifuncmain5staticpic.c += $(pic-ccflag)
1336 CFLAGS-ifuncdep5pic.c += $(pic-ccflag)
1337 CFLAGS-ifuncmain7pic.c += $(pic-ccflag)
1338 CFLAGS-ifuncmain7picstatic.c += $(pic-ccflag)
1339 CFLAGS-ifuncmain9pic.c += $(pic-ccflag)
1340 CFLAGS-ifuncmain9picstatic.c += $(pic-ccflag)
1341
1342 LDFLAGS-ifuncmain3 = -Wl,-export-dynamic
1343
1344 CFLAGS-ifuncmain1pie.c += $(pie-ccflag)
1345 CFLAGS-ifuncmain1vispie.c += $(pie-ccflag)
1346 CFLAGS-ifuncmain1staticpie.c += $(pie-ccflag)
1347 CFLAGS-ifuncmain5pie.c += $(pie-ccflag)
1348 CFLAGS-ifuncmain6pie.c += $(pie-ccflag)
1349 CFLAGS-ifuncmain7pie.c += $(pie-ccflag)
1350 CFLAGS-ifuncmain9pie.c += $(pie-ccflag)
1351 CFLAGS-tst-ifunc-textrel.c += $(pic-ccflag)
1352
1353 $(objpfx)ifuncmain1pie: $(objpfx)ifuncmod1.so
1354 $(objpfx)ifuncmain1staticpie: $(objpfx)ifuncdep1pic.o
1355 $(objpfx)ifuncmain1vispie: $(objpfx)ifuncmod1.so
1356 $(objpfx)ifuncmain5pie: $(objpfx)ifuncmod5.so
1357 $(objpfx)ifuncmain6pie: $(objpfx)ifuncmod6.so
1358
1359 $(objpfx)ifuncmain1: $(addprefix $(objpfx),ifuncmod1.so)
1360 $(objpfx)ifuncmain1pic: $(addprefix $(objpfx),ifuncmod1.so)
1361 $(objpfx)ifuncmain1staticpic: $(addprefix $(objpfx),ifuncdep1pic.o)
1362 $(objpfx)ifuncmain1static: $(addprefix $(objpfx),ifuncdep1.o)
1363 $(objpfx)ifuncmain1picstatic: $(addprefix $(objpfx),ifuncdep1pic.o)
1364 $(objpfx)ifuncmain1vis: $(addprefix $(objpfx),ifuncmod1.so)
1365 $(objpfx)ifuncmain1vispic: $(addprefix $(objpfx),ifuncmod1.so)
1366 $(objpfx)ifuncmain2: $(addprefix $(objpfx),ifuncdep2.o)
1367 $(objpfx)ifuncmain2pic: $(addprefix $(objpfx),ifuncdep2pic.o)
1368 $(objpfx)ifuncmain2static: $(addprefix $(objpfx),ifuncdep2.o)
1369 $(objpfx)ifuncmain2picstatic: $(addprefix $(objpfx),ifuncdep2pic.o)
1370
1371 $(objpfx)ifuncmain3: $(libdl)
1372 $(objpfx)ifuncmain3.out: $(objpfx)ifuncmod3.so
1373
1374 $(objpfx)ifuncmain5: $(addprefix $(objpfx),ifuncmod5.so)
1375 $(objpfx)ifuncmain5pic: $(addprefix $(objpfx),ifuncmod5.so)
1376 $(objpfx)ifuncmain5static: $(addprefix $(objpfx),ifuncdep5.o)
1377 $(objpfx)ifuncmain5staticpic: $(addprefix $(objpfx),ifuncdep5pic.o)
1378 $(objpfx)ifuncmain5picstatic: $(addprefix $(objpfx),ifuncdep5pic.o)
1379
1380 LDFLAGS-tst-ifunc-fault-lazy = -Wl,-z,lazy
1381 LDFLAGS-tst-ifunc-fault-bindnow = -Wl,-z,now
1382 define tst-ifunc-fault-script
1383 ( $(test-wrapper) $(rtld-prefix) --verify $^ \
1384   && $(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 $(rtld-prefix) $^ \
1385   && $(test-wrapper-env) LD_TRACE_LOADED_OBJECTS=1 LD_DEBUG=unused \
1386                          $(rtld-prefix) $^ \
1387 ) > $@; $(evaluate-test)
1388 endef
1389 $(objpfx)tst-ifunc-fault-lazy.out: $(objpfx)tst-ifunc-fault-lazy $(objpfx)ld.so
1390         $(tst-ifunc-fault-script)
1391 $(objpfx)tst-ifunc-fault-bindnow.out: $(objpfx)tst-ifunc-fault-bindnow \
1392    $(objpfx)ld.so
1393         $(tst-ifunc-fault-script)
1394
1395 $(objpfx)tst-unique1: $(libdl)
1396 $(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \
1397                           $(objpfx)tst-unique1mod2.so
1398
1399 $(objpfx)tst-unique2: $(libdl) $(objpfx)tst-unique2mod1.so
1400 $(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so
1401
1402 $(objpfx)tst-unique3: $(libdl) $(objpfx)tst-unique3lib.so
1403 $(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so
1404
1405 $(objpfx)tst-unique4: $(objpfx)tst-unique4lib.so
1406
1407 $(objpfx)tst-nodelete: $(libdl)
1408 $(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \
1409                            $(objpfx)tst-nodelete-rtldmod.so \
1410                            $(objpfx)tst-nodelete-zmod.so
1411
1412 LDFLAGS-tst-nodelete = -rdynamic
1413 LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete
1414
1415 $(objpfx)tst-nodelete2: $(libdl)
1416 $(objpfx)tst-nodelete2.out: $(objpfx)tst-nodelete2mod.so
1417
1418 LDFLAGS-tst-nodelete2 = -rdynamic
1419
1420 $(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out
1421         cmp $^ > $@; \
1422         $(evaluate-test)
1423
1424 $(objpfx)tst-initorder2: $(objpfx)tst-initorder2a.so $(objpfx)tst-initorder2d.so $(objpfx)tst-initorder2c.so
1425 $(objpfx)tst-initorder2a.so: $(objpfx)tst-initorder2b.so
1426 $(objpfx)tst-initorder2b.so: $(objpfx)tst-initorder2c.so
1427 $(objpfx)tst-initorder2c.so: $(objpfx)tst-initorder2d.so
1428 LDFLAGS-tst-initorder2 = -Wl,--no-as-needed
1429 LDFLAGS-tst-initorder2a.so = -Wl,--no-as-needed
1430 LDFLAGS-tst-initorder2b.so = -Wl,--no-as-needed
1431 LDFLAGS-tst-initorder2c.so = -Wl,--no-as-needed
1432 define o-iterator-doit
1433 $(objpfx)tst-initorder2$o.os: tst-initorder2.c; \
1434 $$(compile-command.c) -DNAME=\"$o\"
1435 endef
1436 object-suffixes-left := a b c d
1437 include $(o-iterator)
1438
1439 $(objpfx)tst-initorder2-cmp.out: tst-initorder2.exp $(objpfx)tst-initorder2.out
1440         cmp $^ > $@; \
1441         $(evaluate-test)
1442
1443 $(objpfx)tst-relsort1: $(libdl)
1444 $(objpfx)tst-relsort1mod1.so: $(libm) $(objpfx)tst-relsort1mod2.so
1445 $(objpfx)tst-relsort1mod2.so: $(libm)
1446 $(objpfx)tst-relsort1.out: $(objpfx)tst-relsort1mod1.so \
1447                            $(objpfx)tst-relsort1mod2.so
1448
1449 $(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so
1450         $(test-wrapper-env) \
1451         LD_TRACE_LOADED_OBJECTS=1 \
1452         LD_DEBUG=unused \
1453         LD_PRELOAD= \
1454         $(rtld-prefix) \
1455           $< > $@; \
1456         $(evaluate-test)
1457
1458 $(objpfx)tst-unused-dep-cmp.out: $(objpfx)tst-unused-dep.out
1459         cmp $< /dev/null > $@; \
1460         $(evaluate-test)
1461
1462 $(objpfx)tst-audit11.out: $(objpfx)tst-auditmod11.so $(objpfx)tst-audit11mod1.so
1463 $(objpfx)tst-audit11: $(libdl)
1464 tst-audit11-ENV = LD_AUDIT=$(objpfx)tst-auditmod11.so
1465 $(objpfx)tst-audit11mod1.so: $(objpfx)tst-audit11mod2.so
1466 LDFLAGS-tst-audit11mod2.so = -Wl,--version-script=tst-audit11mod2.map,-soname,tst-audit11mod2.so
1467
1468 $(objpfx)tst-audit12.out: $(objpfx)tst-auditmod12.so $(objpfx)tst-audit12mod1.so $(objpfx)tst-audit12mod3.so
1469 $(objpfx)tst-audit12: $(libdl)
1470 tst-audit12-ENV = LD_AUDIT=$(objpfx)tst-auditmod12.so
1471 $(objpfx)tst-audit12mod1.so: $(objpfx)tst-audit12mod2.so
1472 LDFLAGS-tst-audit12mod2.so = -Wl,--version-script=tst-audit12mod2.map
1473
1474 $(objpfx)tst-audit13.out: $(objpfx)tst-audit13mod1.so
1475 LDFLAGS-tst-audit13mod1.so = -Wl,-z,lazy
1476 tst-audit13-ENV = LD_AUDIT=$(objpfx)tst-audit13mod1.so
1477
1478 $(objpfx)tst-auditmany.out: $(objpfx)tst-auditmanymod1.so \
1479   $(objpfx)tst-auditmanymod2.so $(objpfx)tst-auditmanymod3.so \
1480   $(objpfx)tst-auditmanymod4.so $(objpfx)tst-auditmanymod5.so \
1481   $(objpfx)tst-auditmanymod6.so $(objpfx)tst-auditmanymod7.so \
1482   $(objpfx)tst-auditmanymod8.so $(objpfx)tst-auditmanymod9.so
1483 tst-auditmany-ENV = \
1484   LD_AUDIT=tst-auditmanymod1.so:tst-auditmanymod2.so:tst-auditmanymod3.so:tst-auditmanymod4.so:tst-auditmanymod5.so:tst-auditmanymod6.so:tst-auditmanymod7.so:tst-auditmanymod8.so:tst-auditmanymod9.so
1485
1486 # tst-sonamemove links against an older implementation of the library.
1487 LDFLAGS-tst-sonamemove-linkmod1.so = \
1488   -Wl,--version-script=tst-sonamemove-linkmod1.map \
1489   -Wl,-soname,tst-sonamemove-runmod1.so
1490 LDFLAGS-tst-sonamemove-runmod1.so = -Wl,--no-as-needed \
1491   -Wl,--version-script=tst-sonamemove-runmod1.map \
1492   -Wl,-soname,tst-sonamemove-runmod1.so
1493 LDFLAGS-tst-sonamemove-runmod2.so = \
1494   -Wl,--version-script=tst-sonamemove-runmod2.map \
1495   -Wl,-soname,tst-sonamemove-runmod2.so
1496 $(objpfx)tst-sonamemove-runmod1.so: $(objpfx)tst-sonamemove-runmod2.so
1497 # Link against the link module, but depend on the run-time modules
1498 # for execution.
1499 $(objpfx)tst-sonamemove-link: $(objpfx)tst-sonamemove-linkmod1.so
1500 $(objpfx)tst-sonamemove-link.out: \
1501   $(objpfx)tst-sonamemove-runmod1.so \
1502   $(objpfx)tst-sonamemove-runmod2.so
1503 $(objpfx)tst-sonamemove-dlopen: $(libdl)
1504 $(objpfx)tst-sonamemove-dlopen.out: \
1505   $(objpfx)tst-sonamemove-runmod1.so \
1506   $(objpfx)tst-sonamemove-runmod2.so
1507
1508 # Override -z defs, so that we can reference an undefined symbol.
1509 # Force lazy binding for the same reason.
1510 LDFLAGS-tst-latepthreadmod.so = \
1511   -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all
1512 # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
1513 # function this_function_is_not_defined.
1514 CFLAGS-tst-latepthreadmod.c += -fno-optimize-sibling-calls
1515 $(objpfx)tst-latepthreadmod.so: $(shared-thread-library)
1516 $(objpfx)tst-latepthread: $(libdl)
1517 $(objpfx)tst-latepthread.out: $(objpfx)tst-latepthreadmod.so
1518
1519 # The test modules are parameterized by preprocessor macros.
1520 $(patsubst %,$(objpfx)%.os,$(tst-tls-many-dynamic-modules)): \
1521   $(objpfx)tst-tls-manydynamic%mod.os : tst-tls-manydynamicmod.c
1522         $(compile-command.c) \
1523           -DNAME=tls_global_$* -DSETTER=set_value_$* -DGETTER=get_value_$*
1524 $(objpfx)tst-tls-manydynamic: $(libdl) $(shared-thread-library)
1525 $(objpfx)tst-tls-manydynamic.out: \
1526   $(patsubst %,$(objpfx)%.so,$(tst-tls-many-dynamic-modules))
1527
1528 tst-prelink-ENV = LD_TRACE_PRELINKING=1
1529
1530 $(objpfx)tst-prelink-conflict.out: $(objpfx)tst-prelink.out
1531         grep stdout $< | grep conflict | $(AWK) '{ print $$10, $$11 }' > $@
1532
1533 $(objpfx)tst-prelink-cmp.out: tst-prelink.exp \
1534                               $(objpfx)tst-prelink-conflict.out
1535         cmp $^ > $@; \
1536         $(evaluate-test)
1537
1538 $(objpfx)tst-ldconfig-X.out : tst-ldconfig-X.sh $(objpfx)ldconfig
1539         $(SHELL) $< '$(common-objpfx)' '$(test-wrapper-env)' \
1540                  '$(run-program-env)' > $@; \
1541         $(evaluate-test)
1542
1543 $(objpfx)tst-dlsym-error: $(libdl)
1544
1545 # Test static linking of all the libraries we can possibly link
1546 # together.  Note that in some configurations this may be less than the
1547 # complete list of libraries we build but we try to maxmimize this list.
1548 $(objpfx)tst-linkall-static: \
1549   $(common-objpfx)math/libm.a \
1550   $(common-objpfx)resolv/libresolv.a \
1551   $(common-objpfx)dlfcn/libdl.a \
1552   $(common-objpfx)login/libutil.a \
1553   $(common-objpfx)rt/librt.a \
1554   $(common-objpfx)resolv/libanl.a \
1555   $(static-thread-library)
1556
1557 ifeq ($(build-crypt),yes)
1558 # If we are using NSS crypto and we have the ability to link statically
1559 # then we include libcrypt.a, otherwise we leave out libcrypt.a and
1560 # link as much as we can into the tst-linkall-static test.  This assumes
1561 # that linking with libcrypt.a does everything required to include the
1562 # static NSS crypto library.
1563 ifeq (yesyes,$(nss-crypt)$(static-nss-crypt))
1564 $(objpfx)tst-linkall-static: \
1565   $(common-objpfx)crypt/libcrypt.a
1566 endif
1567 # If we are not using NSS crypto then we always have the ability to link
1568 # with libcrypt.a.
1569 ifeq (no,$(nss-crypt))
1570 $(objpfx)tst-linkall-static: \
1571   $(common-objpfx)crypt/libcrypt.a
1572 endif
1573 endif
1574
1575 # The application depends on the DSO, and the DSO loads the plugin.
1576 # The plugin also depends on the DSO. This creates the circular
1577 # dependency via dlopen that we're testing to make sure works.
1578 $(objpfx)tst-nodelete-dlclose-dso.so: $(libdl)
1579 $(objpfx)tst-nodelete-dlclose-plugin.so: $(objpfx)tst-nodelete-dlclose-dso.so
1580 $(objpfx)tst-nodelete-dlclose: $(objpfx)tst-nodelete-dlclose-dso.so
1581 $(objpfx)tst-nodelete-dlclose.out: $(objpfx)tst-nodelete-dlclose-dso.so \
1582                                    $(objpfx)tst-nodelete-dlclose-plugin.so
1583
1584 tst-env-setuid-ENV = MALLOC_CHECK_=2 MALLOC_MMAP_THRESHOLD_=4096 \
1585                      LD_HWCAP_MASK=0x1
1586 tst-env-setuid-tunables-ENV = \
1587         GLIBC_TUNABLES=glibc.malloc.check=2:glibc.malloc.mmap_threshold=4096
1588
1589 $(objpfx)tst-debug1: $(libdl)
1590 $(objpfx)tst-debug1.out: $(objpfx)tst-debug1mod1.so
1591
1592 $(objpfx)tst-debug1mod1.so: $(objpfx)testobj1.so
1593         $(OBJCOPY) --only-keep-debug $< $@
1594
1595 $(objpfx)tst-main1: $(objpfx)tst-main1mod.so
1596 CRT-tst-main1 := $(csu-objpfx)crt1.o
1597 tst-main1-no-pie = yes
1598 LDLIBS-tst-main1 = $(libsupport)
1599 tst-main1mod.so-no-z-defs = yes
1600
1601 LDLIBS-tst-absolute-sym-lib.so = tst-absolute-sym-lib.lds
1602 $(objpfx)tst-absolute-sym-lib.so: $(LDLIBS-tst-absolute-sym-lib.so)
1603 $(objpfx)tst-absolute-sym: $(objpfx)tst-absolute-sym-lib.so
1604
1605 LDLIBS-tst-absolute-zero-lib.so = tst-absolute-zero-lib.lds
1606 $(objpfx)tst-absolute-zero-lib.so: $(LDLIBS-tst-absolute-zero-lib.so)
1607 $(objpfx)tst-absolute-zero: $(objpfx)tst-absolute-zero-lib.so
1608
1609 # Both the main program and the DSO for tst-libc_dlvsym need to link
1610 # against libdl.
1611 $(objpfx)tst-libc_dlvsym: $(libdl)
1612 $(objpfx)tst-libc_dlvsym-dso.so: $(libsupport) $(libdl)
1613 $(objpfx)tst-libc_dlvsym.out: $(objpfx)tst-libc_dlvsym-dso.so
1614 $(objpfx)tst-libc_dlvsym-static: $(common-objpfx)dlfcn/libdl.a
1615 tst-libc_dlvsym-static-ENV = \
1616   LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
1617 $(objpfx)tst-libc_dlvsym-static.out: $(objpfx)tst-libc_dlvsym-dso.so
1618
1619 $(objpfx)tst-big-note: $(objpfx)tst-big-note-lib.so
1620 # Avoid creating an ABI tag note, which may come before the
1621 # artificial, large note in tst-big-note-lib.o and invalidate the
1622 # test.
1623 $(objpfx)tst-big-note-lib.so: $(objpfx)tst-big-note-lib.o
1624         $(LINK.o) -shared -o $@ $(LDFLAGS.so) $<
1625
1626 $(objpfx)tst-unwind-ctor: $(objpfx)tst-unwind-ctor-lib.so
1627
1628 CFLAGS-tst-unwind-main.c += -funwind-tables -DUSE_PTHREADS=0
1629
1630 $(objpfx)tst-initfinilazyfail: $(libdl)
1631 $(objpfx)tst-initfinilazyfail.out: \
1632   $(objpfx)tst-initlazyfailmod.so $(objpfx)tst-finilazyfailmod.so
1633 # Override -z defs, so that we can reference an undefined symbol.
1634 # Force lazy binding for the same reason.
1635 LDFLAGS-tst-initlazyfailmod.so = \
1636   -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all
1637 LDFLAGS-tst-finilazyfailmod.so = \
1638   -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all
1639
1640 $(objpfx)tst-dlopenfail: $(libdl)
1641 $(objpfx)tst-dlopenfail.out: \
1642   $(objpfx)tst-dlopenfailmod1.so $(objpfx)tst-dlopenfailmod2.so
1643 # Order matters here.  tst-dlopenfaillinkmod.so's soname ensures a
1644 # run-time loader failure.  --as-needed breaks this test because
1645 # nothing actually references tst-dlopenfailmod2.so (with its soname
1646 # tst-dlopenfail-missingmod.so).
1647 LDFLAGS-tst-dlopenfailmod1.so = -Wl,--no-as-needed
1648 $(objpfx)tst-dlopenfailmod1.so: \
1649   $(shared-thread-library) $(objpfx)tst-dlopenfaillinkmod.so
1650 LDFLAGS-tst-dlopenfaillinkmod.so = -Wl,-soname,tst-dlopenfail-missingmod.so
1651 $(objpfx)tst-dlopenfailmod2.so: $(shared-thread-library)
1652 $(objpfx)tst-dlopenfail-2: $(libdl)
1653 $(objpfx)tst-dlopenfail.out: \
1654   $(objpfx)tst-dlopenfailmod1.so $(objpfx)tst-dlopenfailmod2.so \
1655   $(objpfx)tst-dlopenfailmod3.so
1656
1657 $(objpfx)tst-dlopen-nodelete-reloc: $(libdl)
1658 $(objpfx)tst-dlopen-nodelete-reloc.out: \
1659   $(objpfx)tst-dlopen-nodelete-reloc-mod1.so \
1660   $(objpfx)tst-dlopen-nodelete-reloc-mod2.so \
1661   $(objpfx)tst-dlopen-nodelete-reloc-mod3.so \
1662   $(objpfx)tst-dlopen-nodelete-reloc-mod4.so \
1663   $(objpfx)tst-dlopen-nodelete-reloc-mod5.so \
1664   $(objpfx)tst-dlopen-nodelete-reloc-mod6.so \
1665   $(objpfx)tst-dlopen-nodelete-reloc-mod7.so \
1666   $(objpfx)tst-dlopen-nodelete-reloc-mod8.so \
1667   $(objpfx)tst-dlopen-nodelete-reloc-mod9.so \
1668   $(objpfx)tst-dlopen-nodelete-reloc-mod10.so \
1669   $(objpfx)tst-dlopen-nodelete-reloc-mod11.so \
1670   $(objpfx)tst-dlopen-nodelete-reloc-mod12.so \
1671   $(objpfx)tst-dlopen-nodelete-reloc-mod13.so \
1672   $(objpfx)tst-dlopen-nodelete-reloc-mod14.so \
1673   $(objpfx)tst-dlopen-nodelete-reloc-mod15.so \
1674   $(objpfx)tst-dlopen-nodelete-reloc-mod16.so \
1675   $(objpfx)tst-dlopen-nodelete-reloc-mod17.so
1676 tst-dlopen-nodelete-reloc-mod2.so-no-z-defs = yes
1677 LDFLAGS-tst-dlopen-nodelete-reloc-mod2.so = -Wl,-z,nodelete
1678 $(objpfx)tst-dlopen-nodelete-reloc-mod4.so: \
1679   $(objpfx)tst-dlopen-nodelete-reloc-mod3.so
1680 LDFLAGS-tst-dlopen-nodelete-reloc-mod4.so = -Wl,--no-as-needed
1681 $(objpfx)tst-dlopen-nodelete-reloc-mod5.so: \
1682   $(objpfx)tst-dlopen-nodelete-reloc-mod4.so
1683 LDFLAGS-tst-dlopen-nodelete-reloc-mod5.so = -Wl,-z,nodelete,--no-as-needed
1684 tst-dlopen-nodelete-reloc-mod5.so-no-z-defs = yes
1685 tst-dlopen-nodelete-reloc-mod7.so-no-z-defs = yes
1686 $(objpfx)tst-dlopen-nodelete-reloc-mod8.so: $(libdl)
1687 $(objpfx)tst-dlopen-nodelete-reloc-mod10.so: $(libdl)
1688 tst-dlopen-nodelete-reloc-mod11.so-no-z-defs = yes
1689 $(objpfx)tst-dlopen-nodelete-reloc-mod13.so: \
1690   $(objpfx)tst-dlopen-nodelete-reloc-mod12.so
1691 $(objpfx)tst-dlopen-nodelete-reloc-mod15.so: \
1692   $(objpfx)tst-dlopen-nodelete-reloc-mod14.so
1693 tst-dlopen-nodelete-reloc-mod16.so-no-z-defs = yes
1694 $(objpfx)tst-dlopen-nodelete-reloc-mod16.so: \
1695   $(objpfx)tst-dlopen-nodelete-reloc-mod15.so
1696 LDFLAGS-tst-dlopen-nodelete-reloc-mod16.so = -Wl,--no-as-needed
1697 $(objpfx)tst-dlopen-nodelete-reloc-mod17.so: \
1698   $(objpfx)tst-dlopen-nodelete-reloc-mod15.so \
1699   $(objpfx)tst-dlopen-nodelete-reloc-mod16.so
1700 LDFLAGS-tst-dlopen-nodelete-reloc-mod17.so = -Wl,--no-as-needed
1701
1702 $(objpfx)tst-ldconfig-ld_so_conf-update.out: $(objpfx)tst-ldconfig-ld-mod.so
1703 $(objpfx)tst-ldconfig-ld_so_conf-update: $(libdl)
1704
1705 LDFLAGS-tst-filterobj-flt.so = -Wl,--filter=$(objpfx)tst-filterobj-filtee.so
1706 $(objpfx)tst-filterobj: $(objpfx)tst-filterobj-flt.so
1707 $(objpfx)tst-filterobj-dlopen: $(libdl)
1708 $(objpfx)tst-filterobj.out: $(objpfx)tst-filterobj-filtee.so
1709 $(objpfx)tst-filterobj-dlopen.out: $(objpfx)tst-filterobj-filtee.so
1710
1711 LDFLAGS-tst-filterobj-aux.so = -Wl,--auxiliary=$(objpfx)tst-filterobj-filtee.so
1712 $(objpfx)tst-auxobj: $(objpfx)tst-filterobj-aux.so
1713 $(objpfx)tst-auxobj-dlopen: $(libdl)
1714 $(objpfx)tst-auxobj.out: $(objpfx)tst-filterobj-filtee.so
1715 $(objpfx)tst-auxobj-dlopen.out: $(objpfx)tst-filterobj-filtee.so