Fix powerpc fmax, fmin sNaN handling (bug 20947).
[glibc.git] / elf / Makefile
blob330397e5d82ec524aaeb0a24e9624b3289a6e9e6
1 # Copyright (C) 1995-2016 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
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.
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.
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 # <http://www.gnu.org/licenses/>.
18 # Makefile for elf subdirectory of GNU C Library.
20 subdir := elf
22 include ../Makeconfig
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
29 # The core dynamic linking functions are in libc for the static and
30 # profiled libraries.
31 dl-routines = $(addprefix dl-,load lookup object reloc deps hwcaps \
32 runtime init fini debug misc \
33 version profile conflict tls origin scope \
34 execstack caller open close trampoline)
35 ifeq (yes,$(use-ldconfig))
36 dl-routines += dl-cache
37 endif
38 all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
39 # But they are absent from the shared libc, because that code is in ld.so.
40 elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \
41 dl-sysdep
42 shared-only-routines += dl-caller
44 # ld.so uses those routines, plus some special stuff for being the program
45 # interpreter and operating independent of libc.
46 rtld-routines = rtld $(all-dl-routines) dl-sysdep dl-environ dl-minimal \
47 dl-error-minimal
48 all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines)
50 CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
51 CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables
52 CFLAGS-dl-iterate-phdr.c = $(uses-callbacks)
54 ifeq ($(unwind-find-fde),yes)
55 routines += unwind-dw2-fde-glibc
56 shared-only-routines += unwind-dw2-fde-glibc
57 endif
59 before-compile += $(objpfx)trusted-dirs.h
60 generated += trusted-dirs.h trusted-dirs.st for-renamed/renamed.so
61 generated-dirs += for-renamed
63 ifeq ($(build-shared),yes)
64 ld-map = $(common-objpfx)ld.map
65 endif
67 ifeq (yes,$(build-shared))
68 extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os
69 generated += librtld.os dl-allobjs.os ld.so ldd
70 install-others = $(inst_rtlddir)/$(rtld-installed-name)
71 install-bin-script = ldd
72 endif
74 others = sprof sln
75 install-bin = sprof
76 others-static = sln
77 install-rootsbin = sln
78 sln-modules := static-stubs
79 extra-objs += $(sln-modules:=.o)
81 ifeq (yes,$(use-ldconfig))
82 ifeq (yes,$(build-shared))
83 others-static += ldconfig
84 others += ldconfig
85 install-rootsbin += ldconfig
87 ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon static-stubs
88 extra-objs += $(ldconfig-modules:=.o)
89 endif
90 endif
92 # To find xmalloc.c and xstrdup.c
93 vpath %.c ../locale/programs
95 ifeq ($(build-shared),yes)
96 extra-objs += sotruss-lib.os sotruss-lib.so
97 install-others += $(inst_auditdir)/sotruss-lib.so
98 install-bin-script += sotruss
99 generated += sotruss
100 libof-sotruss-lib = extramodules
101 $(objpfx)sotruss-lib.so: $(objpfx)sotruss-lib.os
102 $(build-module-asneeded)
103 $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \
104 $(common-objpfx)libc_nonshared.a
106 $(objpfx)sotruss: sotruss.sh $(common-objpfx)config.make
107 sed -e 's%@BASH@%$(BASH)%g' \
108 -e 's%@VERSION@%$(version)%g' \
109 -e 's%@TEXTDOMAINDIR@%$(localedir)%g' \
110 -e 's%@PREFIX@%$(prefix)%g' \
111 -e 's|@PKGVERSION@|$(PKGVERSION)|g' \
112 -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
113 < $< > $@.new
114 chmod 555 $@.new
115 mv -f $@.new $@
116 $(inst_auditdir)/sotruss-lib.so: $(objpfx)sotruss-lib.so $(+force)
117 $(do-install-program)
118 endif
120 tests = tst-tls1 tst-tls2 tst-tls9 tst-leaks1 \
121 tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 \
122 tst-auxv
123 tests-static = tst-tls1-static tst-tls2-static tst-stackguard1-static \
124 tst-leaks1-static tst-array1-static tst-array5-static \
125 tst-ptrguard1-static tst-dl-iter-static \
126 tst-tlsalign-static tst-tlsalign-extern-static \
127 tst-linkall-static
128 ifeq (yes,$(build-shared))
129 tests-static += tst-tls9-static
130 tst-tls9-static-ENV = \
131 LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
132 endif
133 tests += $(tests-static)
134 ifeq (yes,$(build-shared))
135 tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
136 constload1 order noload filter unload \
137 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
138 nodlopen nodlopen2 neededtest neededtest2 \
139 neededtest3 neededtest4 unload2 lateglobal initfirst global \
140 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
141 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
142 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
143 tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \
144 tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \
145 tst-dlmodcount tst-dlopenrpath tst-deep1 \
146 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
147 unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
148 tst-audit1 tst-audit2 tst-audit8 tst-audit9 \
149 tst-stackguard1 tst-addr1 tst-thrlock \
150 tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4 \
151 tst-nodelete) \
152 tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
153 tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
154 tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload \
155 tst-latepthread tst-tls-manydynamic
156 # reldep9
157 ifeq ($(build-hardcoded-path-in-tests),yes)
158 tests += tst-dlopen-aout
159 LDFLAGS-tst-dlopen-aout = $(no-pie-ldflag)
160 endif
161 test-srcs = tst-pathopt
162 selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null)
163 ifneq ($(selinux-enabled),1)
164 tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
165 endif
166 endif
167 ifeq ($(run-built-tests),yes)
168 tests-special += $(objpfx)tst-leaks1-mem.out \
169 $(objpfx)tst-leaks1-static-mem.out $(objpfx)noload-mem.out \
170 $(objpfx)tst-ldconfig-X.out
171 endif
172 tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
173 tlsmod18a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
174 tlsmod17a-modules = $(addprefix tst-tlsmod17a, $(tlsmod17a-suffixes))
175 tlsmod18a-modules = $(addprefix tst-tlsmod18a, $(tlsmod17a-suffixes))
176 one-hundred = $(foreach x,0 1 2 3 4 5 6 7 8 9, \
177 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x)
178 tst-tls-many-dynamic-modules := \
179 $(foreach n,$(one-hundred),tst-tls-manydynamic$(n)mod)
180 extra-test-objs += $(tlsmod17a-modules:=.os) $(tlsmod18a-modules:=.os) \
181 tst-tlsalign-vars.o
182 test-extras += tst-tlsmod17a tst-tlsmod18a tst-tlsalign-vars
183 modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
184 testobj1_1 failobj constload2 constload3 unloadmod \
185 dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
186 nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
187 nodel2mod1 nodel2mod2 nodel2mod3 \
188 nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
189 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
190 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
191 neededobj1 neededobj2 neededobj3 neededobj4 \
192 neededobj5 neededobj6 firstobj globalmod1 \
193 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \
194 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \
195 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \
196 reldep7mod1 reldep7mod2 \
197 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \
198 tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
199 tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
200 tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
201 tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
202 $(tlsmod17a-modules) tst-tlsmod17b $(tlsmod18a-modules) \
203 tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \
204 circlemod1 circlemod1a circlemod2 circlemod2a \
205 circlemod3 circlemod3a \
206 reldep8mod1 reldep8mod2 reldep8mod3 \
207 reldep9mod1 reldep9mod2 reldep9mod3 \
208 tst-alignmod tst-alignmod2 \
209 $(modules-execstack-$(have-z-execstack)) \
210 tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \
211 tst-dlmopen1mod tst-auditmod1 \
212 unload3mod1 unload3mod2 unload3mod3 unload3mod4 \
213 unload4mod1 unload4mod2 unload4mod3 unload4mod4 \
214 unload6mod1 unload6mod2 unload6mod3 \
215 unload7mod1 unload7mod2 \
216 unload8mod1 unload8mod1x unload8mod2 unload8mod3 \
217 order2mod1 order2mod2 order2mod3 order2mod4 \
218 tst-unique1mod1 tst-unique1mod2 \
219 tst-unique2mod1 tst-unique2mod2 \
220 tst-auditmod9a tst-auditmod9b \
221 $(if $(CXX),tst-unique3lib tst-unique3lib2 tst-unique4lib \
222 tst-nodelete-uniquemod tst-nodelete-rtldmod \
223 tst-nodelete-zmod) \
224 tst-initordera1 tst-initorderb1 \
225 tst-initordera2 tst-initorderb2 \
226 tst-initordera3 tst-initordera4 \
227 tst-initorder2a tst-initorder2b tst-initorder2c \
228 tst-initorder2d \
229 tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
230 tst-array5dep tst-null-argv-lib \
231 tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod \
232 tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \
233 tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \
234 tst-latepthreadmod $(tst-tls-many-dynamic-modules)
235 ifeq (yes,$(have-mtls-dialect-gnu2))
236 tests += tst-gnu2-tls1
237 modules-names += tst-gnu2-tls1mod
238 $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
239 tst-gnu2-tls1mod.so-no-z-defs = yes
240 CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
241 endif
242 ifeq (yes,$(have-protected-data))
243 modules-names += tst-protected1moda tst-protected1modb
244 tests += tst-protected1a tst-protected1b
245 $(objpfx)tst-protected1a: $(addprefix $(objpfx),tst-protected1moda.so tst-protected1modb.so)
246 $(objpfx)tst-protected1b: $(addprefix $(objpfx),tst-protected1modb.so tst-protected1moda.so)
247 tst-protected1modb.so-no-z-defs = yes
248 # These tests fail with GCC versions prior to 5.1 and with some versions
249 # of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709
250 # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details.
251 # Perhaps in future we can make these XFAILs conditional on some detection
252 # of compiler/linker behavior/version.
253 test-xfail-tst-protected1a = yes
254 test-xfail-tst-protected1b = yes
255 endif
256 ifeq (yesyes,$(have-fpie)$(build-shared))
257 modules-names += tst-piemod1
258 tests += tst-pie1 tst-pie2
259 tests-pie += tst-pie1 tst-pie2
260 tests += vismain
261 tests-pie += vismain
262 CFLAGS-vismain.c = $(PIE-ccflag)
263 endif
264 modules-execstack-yes = tst-execstack-mod
265 extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
266 # We need this variable to be sure the test modules get the right CPPFLAGS.
267 test-extras += $(modules-names)
269 # filtmod1.so has a special rule
270 modules-names-nobuild := filtmod1
272 ifneq (no,$(multi-arch))
273 tests-static += ifuncmain1static ifuncmain1picstatic \
274 ifuncmain2static ifuncmain2picstatic \
275 ifuncmain4static ifuncmain4picstatic \
276 ifuncmain5static ifuncmain5picstatic \
277 ifuncmain7static ifuncmain7picstatic
279 ifeq (yes,$(build-shared))
280 tests += ifuncmain1 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \
281 ifuncmain1staticpic \
282 ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \
283 ifuncmain5 ifuncmain5pic ifuncmain5staticpic \
284 ifuncmain7 ifuncmain7pic
285 ifunc-test-modules = ifuncdep1 ifuncdep1pic ifuncdep2 ifuncdep2pic \
286 ifuncdep5 ifuncdep5pic
287 extra-test-objs += $(ifunc-test-modules:=.o)
288 test-extras += $(ifunc-test-modules)
289 ifeq (yes,$(have-fpie))
290 ifunc-pie-tests = ifuncmain1pie ifuncmain1vispie ifuncmain1staticpie \
291 ifuncmain5pie ifuncmain6pie ifuncmain7pie
292 tests += $(ifunc-pie-tests)
293 tests-pie += $(ifunc-pie-tests)
294 endif
295 modules-names += ifuncmod1 ifuncmod3 ifuncmod5 ifuncmod6
296 endif
297 endif
299 ifeq (yes,$(build-shared))
300 ifeq ($(run-built-tests),yes)
301 tests-special += $(objpfx)tst-pathopt.out $(objpfx)tst-rtld-load-self.out
302 endif
303 tests-special += $(objpfx)check-textrel.out $(objpfx)check-execstack.out \
304 $(objpfx)check-localplt.out
305 endif
307 ifeq ($(run-built-tests),yes)
308 tests-special += $(objpfx)order-cmp.out $(objpfx)tst-array1-cmp.out \
309 $(objpfx)tst-array1-static-cmp.out \
310 $(objpfx)tst-array2-cmp.out $(objpfx)tst-array3-cmp.out \
311 $(objpfx)tst-array4-cmp.out $(objpfx)tst-array5-cmp.out \
312 $(objpfx)tst-array5-static-cmp.out $(objpfx)order2-cmp.out \
313 $(objpfx)tst-initorder-cmp.out \
314 $(objpfx)tst-initorder2-cmp.out $(objpfx)tst-unused-dep.out \
315 $(objpfx)tst-unused-dep-cmp.out
316 endif
318 check-abi: $(objpfx)check-abi-ld.out
319 tests-special += $(objpfx)check-abi-ld.out
320 update-abi: update-abi-ld
321 update-all-abi: update-all-abi-ld
323 ifeq ($(have-glob-dat-reloc),yes)
324 tests += tst-prelink
325 ifeq ($(run-built-tests),yes)
326 tests-special += $(objpfx)tst-prelink-cmp.out
327 endif
328 endif
330 # The test requires shared _and_ PIE because the executable
331 # unit test driver must be able to link with the shared object
332 # that is going to eventually go into an installed DSO.
333 ifeq (yesyes,$(have-fpie)$(build-shared))
334 tests += tst-_dl_addr_inside_object
335 tests-pie += tst-_dl_addr_inside_object
336 $(objpfx)tst-_dl_addr_inside_object: $(objpfx)dl-addr-obj.os
337 CFLAGS-tst-_dl_addr_inside_object.c += $(PIE-ccflag)
338 endif
340 # By default tst-linkall-static should try to use crypt routines to test
341 # static libcrypt use.
342 CFLAGS-tst-linkall-static.c = -DUSE_CRYPT=1
343 # However, if we are using NSS crypto and we don't have a static
344 # library, then we exclude the use of crypt functions in the test.
345 # We similarly exclude libcrypt.a from the static link (see below).
346 ifeq (yesno,$(nss-crypt)$(static-nss-crypt))
347 CFLAGS-tst-linkall-static.c = -DUSE_CRYPT=0
348 endif
350 include ../Rules
352 ifeq (yes,$(build-shared))
353 # Make sure these things are built in the `make lib' pass so they can be used
354 # to run programs during the `make others' pass.
355 lib-noranlib: $(objpfx)$(rtld-installed-name) \
356 $(addprefix $(objpfx),$(extra-objs))
357 endif
359 # Command to link into a larger single relocatable object.
360 reloc-link = $(LINK.o) -nostdlib -nostartfiles -r
362 $(objpfx)sotruss-lib.so: $(shlib-lds)
364 $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os)
365 $(reloc-link) -o $@ $^
367 # Link together the dynamic linker into a single relocatable object.
368 # First we do a link against libc_pic.a just to get a link map,
369 # and discard the object produced by that link. From the link map
370 # we can glean all the libc modules that need to go into the dynamic
371 # linker. Then we do a recursive make that goes into all the subdirs
372 # those modules come from and builds special rtld-foo.os versions that
373 # are compiled with special flags, and puts these modules into rtld-libc.a
374 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
376 $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
377 @-rm -f $@T
378 $(reloc-link) -o $@.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T
379 rm -f $@.o
380 mv -f $@T $@
382 $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile
383 LC_ALL=C \
384 sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
385 $< | \
386 while read lib file; do \
387 case $$lib in \
388 libc_pic.a) \
389 LC_ALL=C fgrep -l /$$file \
390 $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \
391 LC_ALL=C \
392 sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
393 ;; \
394 */*.a) \
395 echo rtld-$${lib%%/*} += $$file ;; \
396 *) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \
397 esac; \
398 done > $@T
399 echo rtld-subdirs = `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
400 | LC_ALL=C sort -u` >> $@T
401 mv -f $@T $@
403 $(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE
404 $(MAKE) -f $< -f rtld-Rules
406 $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a
407 $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' \
408 -Wl,-Map,$@.map
410 generated += librtld.map librtld.mk rtld-libc.a librtld.os.map
412 z-now-yes = -Wl,-z,now
414 $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
415 # Link into a temporary file so that we don't touch $@ at all
416 # if the sanity check below fails.
417 $(LINK.o) -nostdlib -nostartfiles -shared -o $@.new \
418 $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
419 $(filter-out $(map-file),$^) $(load-map-file) \
420 -Wl,-soname=$(rtld-installed-name) \
421 -Wl,-defsym=_begin=0
422 $(call after-link,$@.new)
423 $(READELF) -s $@.new \
424 | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
425 mv -f $@.new $@
427 ifeq (yes,$(build-shared))
428 # interp.c exists just to get the runtime linker path into libc.so.
429 $(objpfx)interp.os: $(common-objpfx)runtime-linker.h
430 endif
432 ifneq (ld.so,$(rtld-installed-name))
433 # Make sure ld.so.1 exists in the build directory so we can link
434 # against it.
435 $(objpfx)$(rtld-installed-name): $(objpfx)ld.so
436 $(make-link)
437 generated += $(rtld-installed-name)
438 endif
440 # Build a file mentioning all trustworthy directories to look for shared
441 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
442 # add directories to the list by defining $(user-defined-trusted-dirs)
443 # before starting make.
444 $(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @:
445 $(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig
446 $(make-target-directory)
447 echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
448 | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T};
449 echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T}
450 $(move-if-change) ${@:st=T} ${@:st=h}
451 touch $@
452 CPPFLAGS-dl-load.c = -I$(objpfx). -I$(csu-objpfx).
454 ifeq (yes,$(build-shared))
455 $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force)
456 $(make-target-directory)
457 $(do-install-program)
459 $(inst_rtlddir)/$(rtld-installed-name): \
460 $(inst_slibdir)/$(rtld-version-installed-name) \
461 $(inst_slibdir)/libc-$(version).so
462 $(make-target-directory)
463 $(make-shlib-link)
465 # Special target called by parent to install just the dynamic linker.
466 .PHONY: ldso_install
467 ldso_install: $(inst_rtlddir)/$(rtld-installed-name)
468 endif
471 ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
472 -e 's%@VERSION@%$(version)%g' \
473 -e 's|@PKGVERSION@|$(PKGVERSION)|g' \
474 -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
475 -e 's%@BASH@%$(BASH)%g' \
476 -e 's%@TEXTDOMAINDIR@%$(localedir)%g'
478 ifeq ($(ldd-rewrite-script),no)
479 define gen-ldd
480 LC_ALL=C sed $(ldd-rewrite) < $< > $@.new
481 endef
482 else
483 define gen-ldd
484 LC_ALL=C sed $(ldd-rewrite) < $< \
485 | LC_ALL=C sed -f $(patsubst $(..)/%,/%,$(..)$(ldd-rewrite-script)) > $@.new
486 endef
487 endif
489 $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \
490 $(common-objpfx)config.make
491 $(gen-ldd)
492 chmod 555 $@.new
493 mv -f $@.new $@
495 $(objpfx)sprof: $(libdl)
497 $(objpfx)sln: $(sln-modules:%=$(objpfx)%.o)
499 $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
501 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
502 CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
503 -D'SLIBDIR="$(slibdir)"'
504 libof-ldconfig = ldconfig
505 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
506 CFLAGS-cache.c = $(SYSCONF-FLAGS)
507 CFLAGS-rtld.c = $(SYSCONF-FLAGS)
509 cpp-srcs-left := $(all-rtld-routines:=.os)
510 lib := rtld
511 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
513 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
514 generated += $(addsuffix .so,$(strip $(modules-names)))
516 $(objpfx)testobj1.so: $(libdl)
517 $(objpfx)testobj1_1.so: $(objpfx)testobj1.so $(libdl)
518 $(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl)
519 $(objpfx)testobj3.so: $(libdl)
520 $(objpfx)testobj4.so: $(libdl)
521 $(objpfx)testobj5.so: $(libdl)
522 $(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so $(libdl)
523 $(objpfx)failobj.so: $(objpfx)testobj6.so
524 $(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so
525 $(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so
526 $(objpfx)dep4.so: $(objpfx)dep3.so
527 $(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so
528 $(objpfx)nextmod1.so: $(libdl)
529 $(objpfx)neededobj1.so: $(libdl)
530 $(objpfx)neededobj2.so: $(objpfx)neededobj1.so $(libdl)
531 $(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so $(libdl)
532 $(objpfx)neededobj4.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
533 $(objpfx)neededobj3.so $(libdl)
534 $(objpfx)neededobj6.so: $(objpfx)neededobj5.so
535 $(objpfx)unload2mod.so: $(objpfx)unload2dep.so
536 $(objpfx)ltglobmod2.so: $(libdl)
537 $(objpfx)firstobj.so: $(shared-thread-library)
538 $(objpfx)globalmod1.so: $(libdl)
539 $(objpfx)reldep4mod1.so: $(objpfx)reldep4mod3.so
540 $(objpfx)reldep4mod2.so: $(objpfx)reldep4mod4.so
541 $(objpfx)dblloadmod1.so: $(objpfx)dblloadmod3.so
542 $(objpfx)dblloadmod2.so: $(objpfx)dblloadmod3.so
543 $(objpfx)reldepmod5.so: $(objpfx)reldepmod2.so
544 $(objpfx)reldepmod6.so: $(objpfx)reldepmod2.so
545 $(objpfx)reldep6mod1.so: $(objpfx)reldep6mod0.so
546 $(objpfx)reldep6mod2.so: $(objpfx)reldep6mod1.so
547 $(objpfx)reldep6mod3.so: $(objpfx)reldep6mod2.so
548 $(objpfx)reldep6mod4.so: $(objpfx)reldep6mod1.so
549 $(objpfx)tst-tlsmod3.so: $(objpfx)tst-tlsmod2.so
550 $(objpfx)tst-tlsmod8.so: $(objpfx)tst-tlsmod7.so
551 $(objpfx)tst-tlsmod10.so: $(objpfx)tst-tlsmod9.so
552 $(objpfx)tst-tlsmod12.so: $(objpfx)tst-tlsmod11.so
553 $(objpfx)tst-tlsmod13a.so: $(objpfx)tst-tlsmod13.so
554 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
555 $(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so
556 $(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so
557 $(objpfx)tst-tls19mod1.so: $(objpfx)tst-tls19mod2.so $(objpfx)tst-tls19mod3.so
558 $(objpfx)tst-tls19mod3.so: $(objpfx)ld.so
559 $(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so
560 $(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so
561 $(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so
562 $(objpfx)reldep9mod3.so: $(objpfx)reldep9mod1.so $(objpfx)reldep9mod2.so
563 $(objpfx)unload3mod1.so: $(objpfx)unload3mod3.so
564 $(objpfx)unload3mod2.so: $(objpfx)unload3mod3.so
565 $(objpfx)unload3mod3.so: $(objpfx)unload3mod4.so
566 $(objpfx)unload4mod1.so: $(objpfx)unload4mod2.so $(objpfx)unload4mod3.so
567 $(objpfx)unload4mod2.so: $(objpfx)unload4mod4.so $(objpfx)unload4mod3.so
568 $(objpfx)unload6mod1.so: $(libdl)
569 $(objpfx)unload6mod2.so: $(libdl)
570 $(objpfx)unload6mod3.so: $(libdl)
571 $(objpfx)unload7mod1.so: $(libdl)
572 $(objpfx)unload7mod2.so: $(objpfx)unload7mod1.so
573 $(objpfx)unload8mod1.so: $(objpfx)unload8mod2.so
574 $(objpfx)unload8mod2.so: $(objpfx)unload8mod3.so
575 $(objpfx)unload8mod3.so: $(libdl)
576 $(objpfx)tst-initordera2.so: $(objpfx)tst-initordera1.so
577 $(objpfx)tst-initorderb2.so: $(objpfx)tst-initorderb1.so $(objpfx)tst-initordera2.so
578 $(objpfx)tst-initordera3.so: $(objpfx)tst-initorderb2.so $(objpfx)tst-initorderb1.so
579 $(objpfx)tst-initordera4.so: $(objpfx)tst-initordera3.so
580 $(objpfx)tst-initorder: $(objpfx)tst-initordera4.so $(objpfx)tst-initordera1.so $(objpfx)tst-initorderb2.so
581 $(objpfx)tst-null-argv: $(objpfx)tst-null-argv-lib.so
582 $(objpfx)tst-tlsalign: $(objpfx)tst-tlsalign-lib.so
583 $(objpfx)tst-nodelete-opened.out: $(objpfx)tst-nodelete-opened-lib.so
584 $(objpfx)tst-nodelete-opened: $(libdl)
585 $(objpfx)tst-noload: $(libdl)
587 $(objpfx)tst-tlsalign-extern: $(objpfx)tst-tlsalign-vars.o
588 $(objpfx)tst-tlsalign-extern-static: $(objpfx)tst-tlsalign-vars.o
590 tst-null-argv-ENV = LD_DEBUG=all LD_DEBUG_OUTPUT=$(objpfx)tst-null-argv.debug.out
591 LDFLAGS-nodel2mod3.so = $(no-as-needed)
592 LDFLAGS-reldepmod5.so = $(no-as-needed)
593 LDFLAGS-reldep6mod1.so = $(no-as-needed)
594 LDFLAGS-reldep6mod4.so = $(no-as-needed)
595 LDFLAGS-reldep8mod3.so = $(no-as-needed)
596 LDFLAGS-unload4mod1.so = $(no-as-needed)
597 LDFLAGS-unload4mod2.so = $(no-as-needed)
598 LDFLAGS-tst-initorder = $(no-as-needed)
599 LDFLAGS-tst-initordera2.so = $(no-as-needed)
600 LDFLAGS-tst-initordera3.so = $(no-as-needed)
601 LDFLAGS-tst-initordera4.so = $(no-as-needed)
602 LDFLAGS-tst-initorderb2.so = $(no-as-needed)
603 LDFLAGS-tst-tlsmod5.so = -nostdlib $(no-as-needed)
604 LDFLAGS-tst-tlsmod6.so = -nostdlib $(no-as-needed)
606 testobj1.so-no-z-defs = yes
607 testobj3.so-no-z-defs = yes
608 testobj4.so-no-z-defs = yes
609 testobj5.so-no-z-defs = yes
610 testobj6.so-no-z-defs = yes
611 failobj.so-no-z-defs = yes
612 constload2.so-no-z-defs = yes
613 constload3.so-no-z-defs = yes
614 nodelmod1.so-no-z-defs = yes
615 nodelmod2.so-no-z-defs = yes
616 nodelmod4.so-no-z-defs = yes
617 nodel2mod2.so-no-z-defs = yes
618 reldepmod2.so-no-z-defs = yes
619 reldepmod3.so-no-z-defs = yes
620 reldepmod4.so-no-z-defs = yes
621 reldep4mod4.so-no-z-defs = yes
622 reldep4mod2.so-no-z-defs = yes
623 ltglobmod2.so-no-z-defs = yes
624 dblloadmod3.so-no-z-defs = yes
625 tst-tlsmod1.so-no-z-defs = yes
626 tst-tlsmod2.so-no-z-defs = yes
627 tst-tlsmod3.so-no-z-defs = yes
628 tst-tlsmod4.so-no-z-defs = yes
629 tst-tlsmod7.so-no-z-defs = yes
630 tst-tlsmod8.so-no-z-defs = yes
631 tst-tlsmod9.so-no-z-defs = yes
632 tst-tlsmod10.so-no-z-defs = yes
633 tst-tlsmod12.so-no-z-defs = yes
634 tst-tlsmod14a.so-no-z-defs = yes
635 tst-tlsmod14b.so-no-z-defs = yes
636 tst-tlsmod15a.so-no-z-defs = yes
637 tst-tlsmod16b.so-no-z-defs = yes
638 circlemod2.so-no-z-defs = yes
639 circlemod3.so-no-z-defs = yes
640 circlemod3a.so-no-z-defs = yes
641 reldep8mod2.so-no-z-defs = yes
642 reldep9mod1.so-no-z-defs = yes
643 unload3mod4.so-no-z-defs = yes
644 unload4mod1.so-no-z-defs = yes
645 ifuncmod1.so-no-z-defs = yes
646 ifuncmod5.so-no-z-defs = yes
647 ifuncmod6.so-no-z-defs = yes
648 tst-auditmod9a.so-no-z-defs = yes
649 tst-auditmod9b.so-no-z-defs = yes
650 tst-nodelete-uniquemod.so-no-z-defs = yes
651 tst-nodelete-rtldmod.so-no-z-defs = yes
652 tst-nodelete-zmod.so-no-z-defs = yes
653 tst-nodelete2mod.so-no-z-defs = yes
655 ifeq ($(build-shared),yes)
656 # Build all the modules even when not actually running test programs.
657 tests: $(test-modules)
658 endif
660 $(objpfx)loadtest: $(libdl)
661 LDFLAGS-loadtest = -rdynamic
663 $(objpfx)loadtest.out: $(test-modules)
665 $(objpfx)neededtest: $(libdl)
666 $(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
667 $(objpfx)neededobj3.so
669 $(objpfx)neededtest2: $(libdl)
670 $(objpfx)neededtest2.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
671 $(objpfx)neededobj3.so
673 $(objpfx)neededtest3: $(libdl)
674 $(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
675 $(objpfx)neededobj3.so $(objpfx)neededobj4.so
677 $(objpfx)neededtest4: $(libdl) $(objpfx)neededobj1.so
678 $(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so
680 $(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so $(libdl)
681 LDFLAGS-restest1 = -rdynamic
683 $(objpfx)restest2: $(libdl)
684 LDFLAGS-restest2 = -rdynamic
686 $(objpfx)restest1.out: $(test-modules)
688 preloadtest-preloads = testobj1 testobj2 testobj3 testobj4 testobj5
689 $(objpfx)preloadtest: $(objpfx)testobj6.so
690 LDFLAGS-preloadtest = -rdynamic
691 $(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so)
692 preloadtest-ENV = \
693 LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so)))
695 $(objpfx)loadfail: $(libdl)
696 LDFLAGS-loadfail = -rdynamic
698 $(objpfx)loadfail.out: $(objpfx)failobj.so
700 $(objpfx)multiload: $(libdl)
701 LDFLAGS-multiload = -rdynamic
702 CFLAGS-multiload.c = -DOBJDIR=\"$(elf-objpfx)\"
704 $(objpfx)multiload.out: $(objpfx)testobj1.so
706 $(objpfx)origtest: $(libdl)
707 LDFLAGS-origtest = -rdynamic
708 $(objpfx)origtest.out: $(objpfx)testobj1.so
710 ifeq ($(have-thread-library),yes)
711 $(objpfx)resolvfail: $(libdl) $(shared-thread-library)
712 else
713 $(objpfx)resolvfail: $(libdl)
714 endif
716 $(objpfx)constload1: $(libdl)
717 $(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so
719 $(objpfx)circleload1: $(libdl)
720 $(objpfx)circleload1.out: $(objpfx)circlemod1.so \
721 $(objpfx)circlemod1a.so
723 $(objpfx)circlemod1.so: $(objpfx)circlemod2.so
724 $(objpfx)circlemod2.so: $(objpfx)circlemod3.so
725 $(objpfx)circlemod1a.so: $(objpfx)circlemod2a.so
726 $(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so
728 $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so)
730 $(objpfx)order-cmp.out: $(objpfx)order.out
731 (echo "0123456789" | cmp $< -) > $@; \
732 $(evaluate-test)
734 $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so)
735 $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so)
736 vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so)
738 $(objpfx)noload: $(objpfx)testobj1.so $(libdl)
739 LDFLAGS-noload = -rdynamic $(no-as-needed)
740 $(objpfx)noload.out: $(objpfx)testobj5.so
742 $(objpfx)noload-mem.out: $(objpfx)noload.out
743 $(common-objpfx)malloc/mtrace $(objpfx)noload.mtrace > $@; \
744 $(evaluate-test)
745 noload-ENV = MALLOC_TRACE=$(objpfx)noload.mtrace
747 LDFLAGS-nodelete = -rdynamic
748 LDFLAGS-nodelmod1.so = -Wl,--enable-new-dtags,-z,nodelete
749 LDFLAGS-nodelmod4.so = -Wl,--enable-new-dtags,-z,nodelete
750 $(objpfx)nodelete: $(libdl)
751 $(objpfx)nodelete.out: $(objpfx)nodelmod1.so $(objpfx)nodelmod2.so \
752 $(objpfx)nodelmod3.so
754 LDFLAGS-nodlopenmod.so = -Wl,--enable-new-dtags,-z,nodlopen
755 $(objpfx)nodlopen: $(libdl)
756 $(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so
758 $(objpfx)nodlopenmod2.so: $(objpfx)nodlopenmod.so
759 $(objpfx)nodlopen2: $(libdl)
760 $(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so
762 $(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so
763 $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \
764 -L$(subst :, -L,$(rpath-link)) \
765 -Wl,-rpath-link=$(rpath-link) \
766 $< -Wl,-F,$(objpfx)filtmod2.so
767 $(objpfx)filter: $(objpfx)filtmod1.so
769 $(objpfx)unload: $(libdl)
770 $(objpfx)unload.out: $(objpfx)unloadmod.so
772 $(objpfx)reldep: $(libdl)
773 $(objpfx)reldep.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod2.so
775 $(objpfx)reldep2: $(libdl)
776 $(objpfx)reldep2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so
778 $(objpfx)reldep3: $(libdl)
779 $(objpfx)reldep3.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so
781 $(objpfx)reldep4: $(libdl)
782 $(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so
784 $(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so $(libdl)
785 LDFLAGS-next = $(no-as-needed)
787 $(objpfx)unload2: $(libdl)
788 $(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so
790 $(objpfx)lateglobal: $(libdl)
791 $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so
793 $(objpfx)tst-pathopt: $(libdl)
794 $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
795 $(objpfx)pathoptobj.so
796 $(SHELL) $< $(common-objpfx) '$(test-wrapper-env)' \
797 '$(run-program-env)'; \
798 $(evaluate-test)
800 $(objpfx)tst-rtld-load-self.out: tst-rtld-load-self.sh $(objpfx)ld.so
801 $(SHELL) $^ '$(test-wrapper)' '$(test-wrapper-env)' > $@; \
802 $(evaluate-test)
804 $(objpfx)initfirst: $(libdl)
805 $(objpfx)initfirst.out: $(objpfx)firstobj.so
807 $(objpfx)global: $(objpfx)globalmod1.so
808 $(objpfx)global.out: $(objpfx)reldepmod1.so
810 $(objpfx)dblload: $(libdl)
811 $(objpfx)dblload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so
813 $(objpfx)dblunload: $(libdl)
814 $(objpfx)dblunload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so
816 $(objpfx)reldep5: $(libdl)
817 $(objpfx)reldep5.out: $(objpfx)reldepmod5.so $(objpfx)reldepmod6.so
819 $(objpfx)reldep6: $(libdl)
820 $(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so
822 $(objpfx)reldep7: $(libdl)
823 $(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so
825 $(objpfx)reldep8: $(libdl)
826 $(objpfx)reldep8.out: $(objpfx)reldep8mod3.so
828 LDFLAGS-nodel2mod2.so = -Wl,--enable-new-dtags,-z,nodelete
829 $(objpfx)nodelete2: $(libdl)
830 $(objpfx)nodelete2.out: $(objpfx)nodel2mod3.so
832 $(objpfx)reldep9: $(libdl)
833 $(objpfx)reldep9.out: $(objpfx)reldep9mod3.so
835 $(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so
837 $(objpfx)tst-tls4: $(libdl)
838 $(objpfx)tst-tls4.out: $(objpfx)tst-tlsmod2.so
840 $(objpfx)tst-tls5: $(libdl)
841 $(objpfx)tst-tls5.out: $(objpfx)tst-tlsmod2.so
843 $(objpfx)tst-tls6: $(libdl)
844 $(objpfx)tst-tls6.out: $(objpfx)tst-tlsmod2.so
846 $(objpfx)tst-tls7: $(libdl)
847 $(objpfx)tst-tls7.out: $(objpfx)tst-tlsmod3.so
849 $(objpfx)tst-tls8: $(libdl)
850 $(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so
852 $(objpfx)tst-tls9: $(libdl)
853 $(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
855 $(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so $(objpfx)tst-tlsmod7.so
857 $(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so $(objpfx)tst-tlsmod9.so
859 $(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so $(objpfx)tst-tlsmod11.so
861 $(objpfx)tst-tls13: $(libdl)
862 $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so
864 $(objpfx)tst-tls14: $(objpfx)tst-tlsmod14a.so $(libdl)
865 $(objpfx)tst-tls14.out: $(objpfx)tst-tlsmod14b.so
867 $(objpfx)tst-tls15: $(libdl)
868 $(objpfx)tst-tls15.out: $(objpfx)tst-tlsmod15a.so $(objpfx)tst-tlsmod15b.so
870 $(objpfx)tst-tls-dlinfo: $(libdl)
871 $(objpfx)tst-tls-dlinfo.out: $(objpfx)tst-tlsmod2.so
875 $(objpfx)tst-tls16: $(libdl)
876 $(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so
878 $(objpfx)tst-tls17: $(libdl)
879 $(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so
880 $(patsubst %,$(objpfx)%.os,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.os: tst-tlsmod17a.c
881 $(compile-command.c) -DN=$*
882 $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so
883 $(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)%.so,$(tlsmod17a-modules))
885 $(objpfx)tst-tls18: $(libdl)
886 $(objpfx)tst-tls18.out: $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules))
887 $(patsubst %,$(objpfx)%.os,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.os : tst-tlsmod18a.c
888 $(compile-command.c) -DN=$*
889 $(patsubst %,$(objpfx)%.so,$(tlsmod18a-modules)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so
891 $(objpfx)tst-tls19: $(libdl)
892 $(objpfx)tst-tls19.out: $(objpfx)tst-tls19mod1.so
894 CFLAGS-tst-align.c = $(stack-align-test-flags)
895 CFLAGS-tst-align2.c = $(stack-align-test-flags)
896 CFLAGS-tst-alignmod.c = $(stack-align-test-flags)
897 CFLAGS-tst-alignmod2.c = $(stack-align-test-flags)
898 $(objpfx)tst-align: $(libdl)
899 $(objpfx)tst-align.out: $(objpfx)tst-alignmod.so
900 $(objpfx)tst-align2: $(objpfx)tst-alignmod2.so
902 $(objpfx)unload3: $(libdl)
903 $(objpfx)unload3.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \
904 $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so
906 $(objpfx)unload4: $(libdl)
907 $(objpfx)unload4.out: $(objpfx)unload4mod1.so $(objpfx)unload4mod3.so
909 $(objpfx)unload5: $(libdl)
910 $(objpfx)unload5.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \
911 $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so
913 $(objpfx)unload6: $(libdl)
914 $(objpfx)unload6.out: $(objpfx)unload6mod1.so $(objpfx)unload6mod2.so \
915 $(objpfx)unload6mod3.so
917 $(objpfx)unload7: $(libdl)
918 $(objpfx)unload7.out: $(objpfx)unload7mod1.so $(objpfx)unload7mod2.so
919 unload7-ENV = MALLOC_PERTURB_=85
921 $(objpfx)unload8: $(libdl)
922 $(objpfx)unload8.out: $(objpfx)unload8mod1.so $(objpfx)unload8mod1x.so
924 ifdef libdl
925 $(objpfx)tst-tls9-static: $(common-objpfx)dlfcn/libdl.a
926 $(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
927 endif
929 ifeq ($(have-z-execstack),yes)
930 $(objpfx)tst-execstack: $(libdl)
931 $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
932 CPPFLAGS-tst-execstack.c = -DUSE_PTHREADS=0
933 LDFLAGS-tst-execstack = -Wl,-z,noexecstack
934 LDFLAGS-tst-execstack-mod = -Wl,-z,execstack
936 $(objpfx)tst-execstack-needed: $(objpfx)tst-execstack-mod.so
937 LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack
939 LDFLAGS-tst-execstack-prog = -Wl,-z,execstack
940 CFLAGS-tst-execstack-prog.c += -Wno-trampolines
941 CFLAGS-tst-execstack-mod.c += -Wno-trampolines
942 endif
944 LDFLAGS-tst-array2 = $(no-as-needed)
945 LDFLAGS-tst-array5 = $(no-as-needed)
947 $(objpfx)tst-array1-cmp.out: tst-array1.exp $(objpfx)tst-array1.out
948 cmp $^ > $@; \
949 $(evaluate-test)
951 $(objpfx)tst-array1-static-cmp.out: tst-array1.exp \
952 $(objpfx)tst-array1-static.out
953 cmp $^ > $@; \
954 $(evaluate-test)
956 $(objpfx)tst-array2: $(objpfx)tst-array2dep.so
957 $(objpfx)tst-array2-cmp.out: tst-array2.exp $(objpfx)tst-array2.out
958 cmp $^ > $@; \
959 $(evaluate-test)
961 $(objpfx)tst-array3-cmp.out: tst-array1.exp $(objpfx)tst-array3.out
962 cmp $^ > $@; \
963 $(evaluate-test)
965 $(objpfx)tst-array4: $(libdl)
966 $(objpfx)tst-array4.out: $(objpfx)tst-array2dep.so
967 $(objpfx)tst-array4-cmp.out: tst-array4.exp $(objpfx)tst-array4.out
968 cmp $^ > $@; \
969 $(evaluate-test)
971 $(objpfx)tst-array5: $(objpfx)tst-array5dep.so
972 $(objpfx)tst-array5-cmp.out: tst-array5.exp $(objpfx)tst-array5.out
973 cmp $^ > $@; \
974 $(evaluate-test)
976 $(objpfx)tst-array5-static-cmp.out: tst-array5-static.exp \
977 $(objpfx)tst-array5-static.out
978 cmp $^ > $@; \
979 $(evaluate-test)
981 CFLAGS-tst-pie1.c += $(pie-ccflag)
982 CFLAGS-tst-pie2.c += $(pie-ccflag)
984 $(objpfx)tst-piemod1.so: $(libsupport)
985 $(objpfx)tst-pie1: $(objpfx)tst-piemod1.so
987 ifeq (yes,$(build-shared))
988 all-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
989 $(filter-out $(common-objpfx)linkobj/libc.so, \
990 $(sort $(wildcard $(addprefix $(common-objpfx), \
991 */lib*.so \
992 iconvdata/*.so))))
994 $(all-built-dso:=.dyn): %.dyn: %
995 @rm -f $@T
996 LC_ALL=C $(READELF) -W -d $< > $@T
997 test -s $@T
998 mv -f $@T $@
999 common-generated += $(all-built-dso:$(common-objpfx)%=%.dyn)
1001 $(objpfx)check-textrel.out: $(..)scripts/check-textrel.awk \
1002 $(all-built-dso:=.dyn)
1003 LC_ALL=C $(AWK) -f $^ > $@; \
1004 $(evaluate-test)
1005 generated += check-textrel.out
1007 $(objpfx)execstack-default: $(first-word $(wildcard $(sysdirs:%=%/stackinfo.h)))
1008 $(make-target-directory)
1009 { echo '#include <elf.h>'; \
1010 echo '#include <stackinfo.h>'; \
1011 echo '#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
1012 echo '@@@execstack-no@@@'; \
1013 echo '#else'; \
1014 echo '@@@execstack-yes@@@'; \
1015 echo '#endif'; } | \
1016 $(CC) $(CFLAGS) $(CPPFLAGS) -E -x c-header - | \
1017 sed -n -e 's/^@@@\(.*\)@@@/\1/p' > $@T
1018 mv -f $@T $@
1019 generated += execstack-default
1021 $(all-built-dso:=.phdr): %.phdr: %
1022 @rm -f $@T
1023 LC_ALL=C $(READELF) -W -l $< > $@T
1024 test -s $@T
1025 mv -f $@T $@
1026 common-generated += $(all-built-dso:$(common-objpfx)%=%.phdr)
1028 $(objpfx)check-execstack.out: $(..)scripts/check-execstack.awk \
1029 $(objpfx)execstack-default \
1030 $(all-built-dso:=.phdr)
1031 LC_ALL=C $(AWK) -f $^ > $@; \
1032 $(evaluate-test)
1033 generated += check-execstack.out
1035 $(objpfx)tst-dlmodcount: $(libdl)
1036 $(objpfx)tst-dlmodcount.out: $(test-modules)
1038 $(all-built-dso:=.jmprel): %.jmprel: % Makefile
1039 @rm -f $@T
1040 LC_ALL=C $(READELF) -W -S -d -r $< > $@T
1041 test -s $@T
1042 mv -f $@T $@
1043 common-generated += $(all-built-dso:$(common-objpfx)%=%.jmprel)
1045 localplt-built-dso := $(addprefix $(common-objpfx),\
1046 libc.so \
1047 elf/ld.so \
1048 math/libm.so \
1049 rt/librt.so \
1050 dlfcn/libdl.so \
1051 resolv/libresolv.so \
1052 crypt/libcrypt.so \
1054 ifeq ($(build-mathvec),yes)
1055 localplt-built-dso += $(addprefix $(common-objpfx), mathvec/libmvec.so)
1056 endif
1057 ifeq ($(have-thread-library),yes)
1058 localplt-built-dso += $(filter-out %_nonshared.a, $(shared-thread-library))
1059 endif
1061 vpath localplt.data $(+sysdep_dirs)
1063 $(objpfx)check-localplt.out: $(..)scripts/check-localplt.awk \
1064 $(..)scripts/localplt.awk \
1065 $(localplt-built-dso:=.jmprel) \
1066 localplt.data
1067 LC_ALL=C $(AWK) -f $(filter-out $< %localplt.data,$^) | \
1068 LC_ALL=C $(AWK) -f $< $(filter %localplt.data,$^) - \
1069 > $@; \
1070 $(evaluate-test)
1071 endif
1073 $(objpfx)tst-dlopenrpathmod.so: $(libdl)
1074 $(objpfx)tst-dlopenrpath: $(objpfx)tst-dlopenrpathmod.so $(libdl)
1075 CFLAGS-tst-dlopenrpath.c += -DPFX=\"$(objpfx)\"
1076 LDFLAGS-tst-dlopenrpathmod.so += -Wl,-rpath,\$$ORIGIN/test-subdir
1077 $(objpfx)tst-dlopenrpath.out: $(objpfx)firstobj.so
1079 $(objpfx)tst-deep1mod2.so: $(objpfx)tst-deep1mod3.so
1080 $(objpfx)tst-deep1: $(libdl) $(objpfx)tst-deep1mod1.so
1081 $(objpfx)tst-deep1.out: $(objpfx)tst-deep1mod2.so
1082 LDFLAGS-tst-deep1 += -rdynamic
1083 tst-deep1mod3.so-no-z-defs = yes
1085 $(objpfx)tst-dlmopen1mod.so: $(libdl)
1086 $(objpfx)tst-dlmopen1: $(libdl)
1087 $(objpfx)tst-dlmopen1.out: $(objpfx)tst-dlmopen1mod.so
1089 $(objpfx)tst-dlmopen2: $(libdl)
1090 $(objpfx)tst-dlmopen2.out: $(objpfx)tst-dlmopen1mod.so
1092 $(objpfx)tst-dlmopen3: $(libdl)
1093 $(objpfx)tst-dlmopen3.out: $(objpfx)tst-dlmopen1mod.so
1095 $(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so
1096 tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
1098 $(objpfx)tst-audit2: $(libdl)
1099 $(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so $(objpfx)tst-auditmod9b.so
1100 # Prevent GCC-5 from translating a malloc/memset pair into calloc
1101 CFLAGS-tst-audit2.c += -fno-builtin
1102 tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
1104 $(objpfx)tst-audit9: $(libdl)
1105 $(objpfx)tst-audit9.out: $(objpfx)tst-auditmod9a.so $(objpfx)tst-auditmod9b.so
1106 tst-audit9-ENV = LD_AUDIT=$(objpfx)tst-auditmod9a.so
1108 $(objpfx)tst-audit8: $(libm)
1109 $(objpfx)tst-audit8.out: $(objpfx)tst-auditmod1.so
1110 tst-audit8-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
1112 $(objpfx)tst-global1: $(libdl)
1113 $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so
1115 $(objpfx)order2: $(libdl)
1116 $(objpfx)order2.out: $(objpfx)order2mod1.so $(objpfx)order2mod2.so
1117 $(objpfx)order2-cmp.out: $(objpfx)order2.out
1118 (echo "12345" | cmp $< -) > $@; \
1119 $(evaluate-test)
1120 $(objpfx)order2mod1.so: $(objpfx)order2mod4.so
1121 $(objpfx)order2mod4.so: $(objpfx)order2mod3.so
1122 $(objpfx)order2mod2.so: $(objpfx)order2mod3.so
1123 order2mod2.so-no-z-defs = yes
1124 LDFLAGS-order2mod1.so = $(no-as-needed)
1125 LDFLAGS-order2mod2.so = $(no-as-needed)
1127 tst-stackguard1-ARGS = --command "$(host-test-program-cmd) --child"
1128 tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
1130 tst-ptrguard1-ARGS = --command "$(host-test-program-cmd) --child"
1131 # When built statically, the pointer guard interface uses
1132 # __pointer_chk_guard_local.
1133 CFLAGS-tst-ptrguard1-static.c = -DPTRGUARD_LOCAL
1134 tst-ptrguard1-static-ARGS = --command "$(objpfx)tst-ptrguard1-static --child"
1136 $(objpfx)tst-leaks1: $(libdl)
1137 $(objpfx)tst-leaks1-mem.out: $(objpfx)tst-leaks1.out
1138 $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@; \
1139 $(evaluate-test)
1141 $(objpfx)tst-leaks1-static: $(common-objpfx)dlfcn/libdl.a
1142 $(objpfx)tst-leaks1-static-mem.out: $(objpfx)tst-leaks1-static.out
1143 $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1-static.mtrace > $@; \
1144 $(evaluate-test)
1146 tst-leaks1-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1.mtrace
1147 tst-leaks1-static-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1-static.mtrace
1149 $(objpfx)tst-addr1: $(libdl)
1151 $(objpfx)tst-thrlock: $(libdl) $(shared-thread-library)
1152 $(objpfx)tst-dlopen-aout: $(libdl) $(shared-thread-library)
1154 CFLAGS-ifuncmain1pic.c += $(pic-ccflag)
1155 CFLAGS-ifuncmain1picstatic.c += $(pic-ccflag)
1156 CFLAGS-ifuncmain1staticpic.c += $(pic-ccflag)
1157 CFLAGS-ifuncdep1pic.c += $(pic-ccflag)
1158 CFLAGS-ifuncmain1vispic.c += $(pic-ccflag)
1159 CFLAGS-ifuncmain2pic.c += $(pic-ccflag)
1160 CFLAGS-ifuncmain2picstatic.c += $(pic-ccflag)
1161 CFLAGS-ifuncdep2pic.c += $(pic-ccflag)
1162 CFLAGS-ifuncmain4picstatic.c += $(pic-ccflag)
1163 CFLAGS-ifuncmain5pic.c += $(pic-ccflag)
1164 CFLAGS-ifuncmain5picstatic.c += $(pic-ccflag)
1165 CFLAGS-ifuncmain5staticpic.c += $(pic-ccflag)
1166 CFLAGS-ifuncdep5pic.c += $(pic-ccflag)
1167 CFLAGS-ifuncmain7pic.c += $(pic-ccflag)
1168 CFLAGS-ifuncmain7picstatic.c += $(pic-ccflag)
1170 LDFLAGS-ifuncmain3 = -Wl,-export-dynamic
1172 CFLAGS-ifuncmain1pie.c += $(pie-ccflag)
1173 CFLAGS-ifuncmain1vispie.c += $(pie-ccflag)
1174 CFLAGS-ifuncmain1staticpie.c += $(pie-ccflag)
1175 CFLAGS-ifuncmain5pie.c += $(pie-ccflag)
1176 CFLAGS-ifuncmain6pie.c += $(pie-ccflag)
1177 CFLAGS-ifuncmain7pie.c += $(pie-ccflag)
1179 $(objpfx)ifuncmain1pie: $(objpfx)ifuncmod1.so
1180 $(objpfx)ifuncmain1staticpie: $(objpfx)ifuncdep1pic.o
1181 $(objpfx)ifuncmain1vispie: $(objpfx)ifuncmod1.so
1182 $(objpfx)ifuncmain5pie: $(objpfx)ifuncmod5.so
1183 $(objpfx)ifuncmain6pie: $(objpfx)ifuncmod6.so
1185 $(objpfx)ifuncmain1: $(addprefix $(objpfx),ifuncmod1.so)
1186 $(objpfx)ifuncmain1pic: $(addprefix $(objpfx),ifuncmod1.so)
1187 $(objpfx)ifuncmain1staticpic: $(addprefix $(objpfx),ifuncdep1pic.o)
1188 $(objpfx)ifuncmain1static: $(addprefix $(objpfx),ifuncdep1.o)
1189 $(objpfx)ifuncmain1picstatic: $(addprefix $(objpfx),ifuncdep1pic.o)
1190 $(objpfx)ifuncmain1vis: $(addprefix $(objpfx),ifuncmod1.so)
1191 $(objpfx)ifuncmain1vispic: $(addprefix $(objpfx),ifuncmod1.so)
1192 $(objpfx)ifuncmain2: $(addprefix $(objpfx),ifuncdep2.o)
1193 $(objpfx)ifuncmain2pic: $(addprefix $(objpfx),ifuncdep2pic.o)
1194 $(objpfx)ifuncmain2static: $(addprefix $(objpfx),ifuncdep2.o)
1195 $(objpfx)ifuncmain2picstatic: $(addprefix $(objpfx),ifuncdep2pic.o)
1197 $(objpfx)ifuncmain3: $(libdl)
1198 $(objpfx)ifuncmain3.out: $(objpfx)ifuncmod3.so
1200 $(objpfx)ifuncmain5: $(addprefix $(objpfx),ifuncmod5.so)
1201 $(objpfx)ifuncmain5pic: $(addprefix $(objpfx),ifuncmod5.so)
1202 $(objpfx)ifuncmain5static: $(addprefix $(objpfx),ifuncdep5.o)
1203 $(objpfx)ifuncmain5staticpic: $(addprefix $(objpfx),ifuncdep5pic.o)
1204 $(objpfx)ifuncmain5picstatic: $(addprefix $(objpfx),ifuncdep5pic.o)
1206 $(objpfx)tst-unique1: $(libdl)
1207 $(objpfx)tst-unique1.out: $(objpfx)tst-unique1mod1.so \
1208 $(objpfx)tst-unique1mod2.so
1210 $(objpfx)tst-unique2: $(libdl) $(objpfx)tst-unique2mod1.so
1211 $(objpfx)tst-unique2.out: $(objpfx)tst-unique2mod2.so
1213 $(objpfx)tst-unique3: $(libdl) $(objpfx)tst-unique3lib.so
1214 $(objpfx)tst-unique3.out: $(objpfx)tst-unique3lib2.so
1216 $(objpfx)tst-unique4: $(objpfx)tst-unique4lib.so
1218 $(objpfx)tst-nodelete: $(libdl)
1219 $(objpfx)tst-nodelete.out: $(objpfx)tst-nodelete-uniquemod.so \
1220 $(objpfx)tst-nodelete-rtldmod.so \
1221 $(objpfx)tst-nodelete-zmod.so
1223 LDFLAGS-tst-nodelete = -rdynamic
1224 LDFLAGS-tst-nodelete-zmod.so = -Wl,--enable-new-dtags,-z,nodelete
1226 $(objpfx)tst-nodelete2: $(libdl)
1227 $(objpfx)tst-nodelete2.out: $(objpfx)tst-nodelete2mod.so
1229 LDFLAGS-tst-nodelete2 = -rdynamic
1231 $(objpfx)tst-initorder-cmp.out: tst-initorder.exp $(objpfx)tst-initorder.out
1232 cmp $^ > $@; \
1233 $(evaluate-test)
1235 $(objpfx)tst-initorder2: $(objpfx)tst-initorder2a.so $(objpfx)tst-initorder2d.so $(objpfx)tst-initorder2c.so
1236 $(objpfx)tst-initorder2a.so: $(objpfx)tst-initorder2b.so
1237 $(objpfx)tst-initorder2b.so: $(objpfx)tst-initorder2c.so
1238 $(objpfx)tst-initorder2c.so: $(objpfx)tst-initorder2d.so
1239 LDFLAGS-tst-initorder2 = $(no-as-needed)
1240 LDFLAGS-tst-initorder2a.so = $(no-as-needed)
1241 LDFLAGS-tst-initorder2b.so = $(no-as-needed)
1242 LDFLAGS-tst-initorder2c.so = $(no-as-needed)
1243 define o-iterator-doit
1244 $(objpfx)tst-initorder2$o.os: tst-initorder2.c; \
1245 $$(compile-command.c) -DNAME=\"$o\"
1246 endef
1247 object-suffixes-left := a b c d
1248 include $(o-iterator)
1250 $(objpfx)tst-initorder2-cmp.out: tst-initorder2.exp $(objpfx)tst-initorder2.out
1251 cmp $^ > $@; \
1252 $(evaluate-test)
1254 $(objpfx)tst-relsort1: $(libdl)
1255 $(objpfx)tst-relsort1mod1.so: $(libm) $(objpfx)tst-relsort1mod2.so
1256 $(objpfx)tst-relsort1mod2.so: $(libm)
1257 $(objpfx)tst-relsort1.out: $(objpfx)tst-relsort1mod1.so \
1258 $(objpfx)tst-relsort1mod2.so
1260 $(objpfx)tst-unused-dep.out: $(objpfx)testobj1.so
1261 $(test-wrapper-env) \
1262 LD_TRACE_LOADED_OBJECTS=1 \
1263 LD_DEBUG=unused \
1264 LD_PRELOAD= \
1265 $(rtld-prefix) \
1266 $< > $@; \
1267 $(evaluate-test)
1269 $(objpfx)tst-unused-dep-cmp.out: $(objpfx)tst-unused-dep.out
1270 cmp $< /dev/null > $@; \
1271 $(evaluate-test)
1273 $(objpfx)tst-audit11.out: $(objpfx)tst-auditmod11.so $(objpfx)tst-audit11mod1.so
1274 $(objpfx)tst-audit11: $(libdl)
1275 tst-audit11-ENV = LD_AUDIT=$(objpfx)tst-auditmod11.so
1276 $(objpfx)tst-audit11mod1.so: $(objpfx)tst-audit11mod2.so
1277 LDFLAGS-tst-audit11mod2.so = -Wl,--version-script=tst-audit11mod2.map,-soname,tst-audit11mod2.so
1279 $(objpfx)tst-audit12.out: $(objpfx)tst-auditmod12.so $(objpfx)tst-audit12mod1.so $(objpfx)tst-audit12mod3.so
1280 $(objpfx)tst-audit12: $(libdl)
1281 tst-audit12-ENV = LD_AUDIT=$(objpfx)tst-auditmod12.so
1282 $(objpfx)tst-audit12mod1.so: $(objpfx)tst-audit12mod2.so
1283 LDFLAGS-tst-audit12mod2.so = -Wl,--version-script=tst-audit12mod2.map
1285 # Override -z defs, so that we can reference an undefined symbol.
1286 # Force lazy binding for the same reason.
1287 LDFLAGS-tst-latepthreadmod.so = \
1288 -Wl,-z,lazy -Wl,--unresolved-symbols=ignore-all
1289 # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
1290 # function this_function_is_not_defined.
1291 CFLAGS-tst-latepthreadmod.c = -fno-optimize-sibling-calls
1292 $(objpfx)tst-latepthreadmod.so: $(shared-thread-library)
1293 $(objpfx)tst-latepthread: $(libdl)
1294 $(objpfx)tst-latepthread.out: $(objpfx)tst-latepthreadmod.so
1296 # The test modules are parameterized by preprocessor macros.
1297 $(patsubst %,$(objpfx)%.os,$(tst-tls-many-dynamic-modules)): \
1298 $(objpfx)tst-tls-manydynamic%mod.os : tst-tls-manydynamicmod.c
1299 $(compile-command.c) \
1300 -DNAME=tls_global_$* -DSETTER=set_value_$* -DGETTER=get_value_$*
1301 $(objpfx)tst-tls-manydynamic: $(libdl) $(shared-thread-library)
1302 $(objpfx)tst-tls-manydynamic.out: \
1303 $(patsubst %,$(objpfx)%.so,$(tst-tls-many-dynamic-modules))
1305 tst-prelink-ENV = LD_TRACE_PRELINKING=1
1307 $(objpfx)tst-prelink-conflict.out: $(objpfx)tst-prelink.out
1308 grep stdout $< | grep conflict | $(AWK) '{ print $$10, $$11 }' > $@
1310 $(objpfx)tst-prelink-cmp.out: tst-prelink.exp \
1311 $(objpfx)tst-prelink-conflict.out
1312 cmp $^ > $@; \
1313 $(evaluate-test)
1315 $(objpfx)tst-ldconfig-X.out : tst-ldconfig-X.sh $(objpfx)ldconfig
1316 $(SHELL) $< '$(common-objpfx)' '$(test-wrapper)' '$(test-wrapper-env)' > $@; \
1317 $(evaluate-test)
1319 $(objpfx)tst-dlsym-error: $(libdl)
1321 # Test static linking of all the libraries we can possibly link
1322 # together. Note that in some configurations this may be less than the
1323 # complete list of libraries we build but we try to maxmimize this list.
1324 $(objpfx)tst-linkall-static: \
1325 $(common-objpfx)math/libm.a \
1326 $(common-objpfx)resolv/libresolv.a \
1327 $(common-objpfx)dlfcn/libdl.a \
1328 $(common-objpfx)login/libutil.a \
1329 $(common-objpfx)rt/librt.a \
1330 $(common-objpfx)resolv/libanl.a \
1331 $(static-thread-library)
1333 # If we are using NSS crypto and we have the ability to link statically
1334 # then we include libcrypt.a, otherwise we leave out libcrypt.a and
1335 # link as much as we can into the tst-linkall-static test. This assumes
1336 # that linking with libcrypt.a does everything required to include the
1337 # static NSS crypto library.
1338 ifeq (yesyes,$(nss-crypt)$(static-nss-crypt))
1339 $(objpfx)tst-linkall-static: \
1340 $(common-objpfx)crypt/libcrypt.a
1341 endif
1342 # If we are not using NSS crypto then we always have the ability to link
1343 # with libcrypt.a.
1344 ifeq (no,$(nss-crypt))
1345 $(objpfx)tst-linkall-static: \
1346 $(common-objpfx)crypt/libcrypt.a
1347 endif