Don't include signal.h, sys/ucontext.h and asm/elf.h. Include sys/user.h.
[glibc/history.git] / elf / Makefile
blobe44ff1d38224ee56f5d387157215cc75dfba6802
1 # Copyright (C) 1995-2007, 2008, 2009 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, write to the Free
16 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 # 02111-1307 USA.
19 # Makefile for elf subdirectory of GNU C Library.
21 subdir := elf
23 headers = elf.h bits/elfclass.h link.h bits/link.h
24 routines = $(dl-routines) dl-support dl-iteratephdr \
25 dl-addr enbl-secure dl-profstub \
26 dl-origin dl-libc dl-sym dl-tsd dl-sysdep
28 # The core dynamic linking functions are in libc for the static and
29 # profiled libraries.
30 dl-routines = $(addprefix dl-,load cache lookup object reloc deps \
31 runtime error init fini debug misc \
32 version profile conflict tls origin \
33 execstack caller open close trampoline)
34 all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
35 # But they are absent from the shared libc, because that code is in ld.so.
36 elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \
37 dl-sysdep
38 shared-only-routines += dl-caller
40 # ld.so uses those routines, plus some special stuff for being the program
41 # interpreter and operating independent of libc.
42 rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal
43 all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines)
45 distribute := rtld-Rules \
46 $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
47 dl-cache.h dl-hash.h soinit.c sofini.c ldd.bash.in \
48 genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \
49 dl-librecon.h interp.c sln.c dl-dst.h hp-timing.h \
50 do-lookup.h dl-lookupcfg.h sprof.c gen-trusted-dirs.awk \
51 testobj1.c testobj2.c testobj3.c testobj4.c testobj5.c \
52 testobj6.c testobj1_1.c failobj.c unloadmod.c \
53 ldconfig.h ldconfig.c cache.c readlib.c readelflib.c \
54 chroot_canon.c gccframe.h \
55 dep1.c dep2.c dep3.c dep4.c dl-dtprocnum.h unsecvars.h \
56 vismain.c vismod1.c vismod2.c vismod3.c \
57 constload2.c constload3.c filtmod1.c filtmod2.c \
58 nodlopenmod.c nodelete.c nodelmod1.c nodelmod2.c \
59 nodelmod3.c nodelmod4.c nodlopen.c dl-osinfo.h \
60 reldepmod1.c reldepmod2.c reldepmod3.c reldepmod4.c \
61 reldepmod5.c reldepmod6.c \
62 reldep4mod1.c reldep4mod2.c reldep4mod3.c reldep4mod4.c \
63 nextmod1.c nextmod2.c pathoptobj.c tst-pathopt.sh \
64 neededobj1.c neededobj2.c neededobj3.c neededobj4.c \
65 neededobj5.c neededobj6.c firstobj.c \
66 unload2mod.c unload2dep.c ltglobmod1.c ltglobmod2.c \
67 testobj.h vismod.h globalmod1.c \
68 dblloadmod1.c dblloadmod2.c dblloadmod3.c \
69 reldep6mod4.c reldep6mod3.c reldep6mod2.c reldep6mod1.c \
70 reldep6mod0.c reldep7mod1.c reldep7mod2.c \
71 unwind-dw2.c unwind-dw2-fde.c unwind.h unwind-pe.h \
72 unwind-dw2-fde.h dwarf2.h dl-procinfo.c tls.h dl-tls.h \
73 tst-tlsmod1.c tst-tlsmod2.c tst-tlsmod3.c tst-tlsmod4.c \
74 tst-tlsmod5.c tst-tlsmod6.c tst-tlsmod7.c tst-tlsmod8.c \
75 tst-tlsmod9.c tst-tlsmod10.c tst-tlsmod11.c \
76 tst-tlsmod12.c tst-tls10.h tst-alignmod.c tst-alignmod2.c \
77 circlemod1.c circlemod1a.c circlemod2.c circlemod2a.c \
78 circlemod3.c circlemod3a.c nodlopenmod2.c \
79 tls-macros.h \
80 reldep8mod1.c reldep8mod2.c reldep8mod3.c \
81 nodel2mod1.c nodel2mod2.c nodel2mod3.c \
82 reldep9.c reldep9mod1.c reldep9mod2.c reldep9mod3.c \
83 tst-array1.exp tst-array2.exp tst-array4.exp \
84 tst-array2dep.c tst-piemod1.c \
85 tst-execstack-mod.c tst-dlmodcount.c \
86 check-textrel.c dl-sysdep.h test-dlopenrpathmod.c \
87 tst-deep1mod1.c tst-deep1mod2.c tst-deep1mod3.c \
88 unload3mod1.c unload3mod2.c unload3mod3.c unload3mod4.c \
89 unload4mod1.c unload4mod2.c unload4mod3.c unload4mod4.c \
90 unload6mod1.c unload6mod2.c unload6mod3.c \
91 unload7mod1.c unload7mod2.c \
92 tst-auditmod1.c tst-audit.sh \
93 order2mod1.c order2mod2.c order2mod3.c order2mod4.c \
94 tst-stackguard1.c tst-stackguard1-static.c \
95 tst-array5.c tst-array5-static.c tst-array5dep.c \
96 tst-array5.exp tst-leaks1.c
98 CFLAGS-dl-runtime.c = -fexceptions -fasynchronous-unwind-tables
99 CFLAGS-dl-lookup.c = -fexceptions -fasynchronous-unwind-tables
100 CFLAGS-dl-iterate-phdr.c = $(uses-callbacks)
102 include ../Makeconfig
104 ifeq ($(unwind-find-fde),yes)
105 routines += unwind-dw2-fde-glibc
106 shared-only-routines += unwind-dw2-fde-glibc
107 endif
109 before-compile = $(objpfx)trusted-dirs.h
110 generated := trusted-dirs.h trusted-dirs.st for-renamed/renamed.so
111 generated-dirs := for-renamed
113 ifeq ($(versioning),yes)
114 ld-map = $(common-objpfx)ld.map
115 endif
117 ifeq (yes,$(build-shared))
118 extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os
119 generated += librtld.os dl-allobjs.os ld.so ldd
120 install-others = $(inst_slibdir)/$(rtld-installed-name)
121 install-bin-script = ldd
122 endif
124 others = sprof sln
125 install-bin = sprof
126 others-static = sln
127 install-rootsbin = sln
129 ifeq (yes,$(use-ldconfig))
130 ifeq (yes,$(build-shared))
131 others-static += ldconfig
132 others += ldconfig
133 install-rootsbin += ldconfig
135 ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon
136 extra-objs += $(ldconfig-modules:=.o)
138 # To find xmalloc.c and xstrdup.c
139 vpath %.c ../locale/programs
141 endif
142 endif
144 tests = tst-tls1 tst-tls2 tst-tls9 tst-leaks1
145 ifeq (yes,$(have-initfini-array))
146 tests += tst-array1 tst-array2 tst-array3 tst-array4 tst-array5
147 endif
148 ifeq (yes,$(build-static))
149 tests-static = tst-tls1-static tst-tls2-static tst-stackguard1-static
150 ifeq (yesyesyes,$(build-static)$(build-shared)$(elf))
151 tests-static += tst-tls9-static
152 tst-tls9-static-ENV = \
153 LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
154 endif
155 ifeq (yes,$(have-initfini-array))
156 tests-static += tst-array1-static tst-array5-static
157 endif
158 tests += $(tests-static)
159 endif
160 ifeq (yes,$(build-shared))
161 tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
162 constload1 order vismain noload filter unload \
163 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
164 nodlopen nodlopen2 neededtest neededtest2 \
165 neededtest3 neededtest4 unload2 lateglobal initfirst global \
166 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
167 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
168 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
169 tst-tls16 tst-tls17 tst-tls18 tst-tls-dlinfo \
170 tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \
171 tst-dlmodcount tst-dlopenrpath tst-deep1 \
172 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
173 unload3 unload4 unload5 unload6 unload7 tst-global1 order2 \
174 tst-audit1 tst-audit2 \
175 tst-stackguard1 tst-addr1 tst-thrlock
176 # reldep9
177 test-srcs = tst-pathopt
178 tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
179 endif
180 ifeq (yesyes,$(have-fpie)$(build-shared))
181 tests: $(objpfx)tst-pie1.out
182 endif
183 tests: $(objpfx)tst-leaks1-mem
184 tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
185 tlsmod18a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
186 modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
187 testobj1_1 failobj constload2 constload3 unloadmod \
188 dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
189 nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
190 nodel2mod1 nodel2mod2 nodel2mod3 \
191 nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
192 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
193 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
194 neededobj1 neededobj2 neededobj3 neededobj4 \
195 neededobj5 neededobj6 firstobj globalmod1 \
196 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \
197 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \
198 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \
199 reldep7mod1 reldep7mod2 \
200 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \
201 tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
202 tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
203 tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
204 tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
205 $(patsubst %,tst-tlsmod17a%,$(tlsmod17a-suffixes)) \
206 tst-tlsmod17b \
207 $(patsubst %,tst-tlsmod18a%,$(tlsmod18a-suffixes)) \
208 circlemod1 circlemod1a circlemod2 circlemod2a \
209 circlemod3 circlemod3a \
210 reldep8mod1 reldep8mod2 reldep8mod3 \
211 reldep9mod1 reldep9mod2 reldep9mod3 \
212 tst-alignmod tst-alignmod2 \
213 $(modules-execstack-$(have-z-execstack)) \
214 tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \
215 tst-dlmopen1mod tst-auditmod1 \
216 unload3mod1 unload3mod2 unload3mod3 unload3mod4 \
217 unload4mod1 unload4mod2 unload4mod3 unload4mod4 \
218 unload6mod1 unload6mod2 unload6mod3 \
219 unload7mod1 unload7mod2 \
220 order2mod1 order2mod2 order2mod3 order2mod4
221 ifeq (yes,$(have-initfini-array))
222 modules-names += tst-array2dep tst-array5dep
223 endif
224 ifeq (yesyes,$(have-fpie)$(build-shared))
225 modules-names += tst-piemod1
226 endif
227 modules-execstack-yes = tst-execstack-mod
228 extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
229 # We need this variable to be sure the test modules get the right CPPFLAGS.
230 test-extras += $(modules-names)
232 # filtmod1.so has a special rule
233 modules-names-nobuild := filtmod1
236 include ../Rules
238 check-abi: check-abi-ld
239 update-abi: update-abi-ld
241 ifeq (yes,$(build-shared))
242 # Make sure these things are built in the `make lib' pass so they can be used
243 # to run programs during the `make others' pass.
244 lib-noranlib: $(objpfx)$(rtld-installed-name) \
245 $(addprefix $(objpfx),$(extra-objs))
246 endif
248 # Command to link into a larger single relocatable object.
249 reloc-link = $(LINK.o) -nostdlib -nostartfiles -r
251 $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os)
252 $(reloc-link) -o $@ $^
254 # Link together the dynamic linker into a single relocatable object.
255 # First we do a link against libc_pic.a just to get a link map,
256 # and discard the object produced by that link. From the link map
257 # we can glean all the libc modules that need to go into the dynamic
258 # linker. Then we do a recursive make that goes into all the subdirs
259 # those modules come from and builds special rtld-foo.os versions that
260 # are compiled with special flags, and puts these modules into rtld-libc.a
261 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
263 $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
264 @-rm -f $@T
265 $(reloc-link) -o $@.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T
266 rm -f $@.o
267 mv -f $@T $@
269 $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile
270 LC_ALL=C \
271 sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
272 $< | \
273 while read lib file; do \
274 case $$lib in \
275 libc_pic.a) \
276 LC_ALL=C fgrep -l /$$file \
277 $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \
278 LC_ALL=C \
279 sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
280 ;; \
281 */*.a) \
282 echo rtld-$${lib%%/*} += $$file ;; \
283 *) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \
284 esac; \
285 done > $@T
286 echo rtld-subdirs = `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
287 | LC_ALL=C sort -u` >> $@T
288 mv -f $@T $@
290 $(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE
291 $(MAKE) -f $< -f rtld-Rules
293 $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a
294 $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' \
295 -Wl,-Map,$@.map
297 generated += librtld.map librtld.mk rtld-libc.a librtld.os.map
299 z-now-yes = -Wl,-z,now
301 $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
302 @rm -f $@.lds
303 $(LINK.o) -nostdlib -nostartfiles -shared $(z-now-$(bind-now)) \
304 $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \
305 LC_ALL=C \
306 sed -e '/^=========/,/^=========/!d;/^=========/d' \
307 -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
308 > $@.lds
309 $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
310 $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
311 $(filter-out $(map-file),$^) $(load-map-file) \
312 -Wl,-soname=$(rtld-installed-name) -T $@.lds
313 rm -f $@.lds
314 readelf -s $@ \
315 | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
317 # interp.c exists just to get this string into the libraries.
318 CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \
319 -DNOT_IN_libc=1
320 $(objpfx)interp.os: $(common-objpfx)config.make
322 ifneq (ld.so,$(rtld-installed-name))
323 # Make sure ld.so.1 exists in the build directory so we can link
324 # against it.
325 $(objpfx)$(rtld-installed-name): $(objpfx)ld.so
326 rm -f $@
327 ln -s $(<F) $@
328 generated += $(rtld-installed-name)
329 endif
331 # Build a file mentioning all trustworthy directories to look for shared
332 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
333 # add directories to the list by defining $(user-defined-trusted-dirs)
334 # before starting make.
335 $(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @:
336 $(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig
337 $(make-target-directory)
338 echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
339 | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T};
340 echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T}
341 $(move-if-change) ${@:st=T} ${@:st=h}
342 touch $@
343 CPPFLAGS-dl-load.c = -I$(objpfx). -I$(csu-objpfx).
345 ifeq (yes,$(build-shared))
346 $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force)
347 $(make-target-directory)
348 $(do-install-program)
350 $(inst_slibdir)/$(rtld-installed-name): \
351 $(inst_slibdir)/$(rtld-version-installed-name) \
352 $(inst_slibdir)/libc-$(version).so
353 $(make-shlib-link)
355 # Special target called by parent to install just the dynamic linker.
356 .PHONY: ldso_install
357 ldso_install: $(inst_slibdir)/$(rtld-installed-name)
358 endif
361 common-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
362 -e 's%@VERSION@%$(version)%g'
363 sh-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%/bin/sh%g;s/\$$"/"/g'
364 bash-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%$(BASH)%g' \
365 -e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g'
367 ifneq ($(have-bash2),yes)
368 ldd-shell = sh
369 else
370 ldd-shell = bash
371 endif
373 ifeq ($(ldd-rewrite-script),no)
374 define gen-ldd
375 LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new
376 endef
377 else
378 define gen-ldd
379 LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< | LC_ALL=C sed -f $(ldd-rewrite-script) > $@.new
380 endef
381 endif
383 $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \
384 $(common-objpfx)config.make
385 $(gen-ldd)
386 chmod 555 $@.new
387 mv -f $@.new $@
389 $(objpfx)sprof: $(libdl)
391 $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
392 SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
393 CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
394 -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
395 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
396 CFLAGS-cache.c = $(SYSCONF-FLAGS)
398 CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
400 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
401 generated += $(addsuffix .so,$(strip $(modules-names)))
403 ifeq (yes,$(build-shared))
404 ifeq ($(cross-compiling),no)
405 tests: $(objpfx)tst-pathopt.out
406 endif
407 endif
409 $(objpfx)testobj1.so: $(libdl)
410 $(objpfx)testobj1_1.so: $(objpfx)testobj1.so $(libdl)
411 $(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl)
412 $(objpfx)testobj3.so: $(libdl)
413 $(objpfx)testobj4.so: $(libdl)
414 $(objpfx)testobj5.so: $(libdl)
415 $(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so $(libdl)
416 $(objpfx)failobj.so: $(objpfx)testobj6.so
417 $(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so
418 $(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so
419 $(objpfx)dep4.so: $(objpfx)dep3.so
420 $(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so
421 $(objpfx)nextmod1.so: $(libdl)
422 $(objpfx)neededobj1.so: $(libdl)
423 $(objpfx)neededobj2.so: $(objpfx)neededobj1.so $(libdl)
424 $(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so $(libdl)
425 $(objpfx)neededobj4.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
426 $(objpfx)neededobj3.so $(libdl)
427 $(objpfx)neededobj6.so: $(objpfx)neededobj5.so
428 $(objpfx)unload2mod.so: $(objpfx)unload2dep.so
429 $(objpfx)ltglobmod2.so: $(libdl)
430 $(objpfx)firstobj.so: $(shared-thread-library)
431 $(objpfx)globalmod1.so: $(libdl)
432 $(objpfx)reldep4mod1.so: $(objpfx)reldep4mod3.so
433 $(objpfx)reldep4mod2.so: $(objpfx)reldep4mod4.so
434 $(objpfx)dblloadmod1.so: $(objpfx)dblloadmod3.so
435 $(objpfx)dblloadmod2.so: $(objpfx)dblloadmod3.so
436 $(objpfx)reldepmod5.so: $(objpfx)reldepmod2.so
437 $(objpfx)reldepmod6.so: $(objpfx)reldepmod2.so
438 $(objpfx)reldep6mod1.so: $(objpfx)reldep6mod0.so
439 $(objpfx)reldep6mod2.so: $(objpfx)reldep6mod1.so
440 $(objpfx)reldep6mod3.so: $(objpfx)reldep6mod2.so
441 $(objpfx)reldep6mod4.so: $(objpfx)reldep6mod1.so
442 $(objpfx)tst-tlsmod3.so: $(objpfx)tst-tlsmod2.so
443 $(objpfx)tst-tlsmod8.so: $(objpfx)tst-tlsmod7.so
444 $(objpfx)tst-tlsmod10.so: $(objpfx)tst-tlsmod9.so
445 $(objpfx)tst-tlsmod12.so: $(objpfx)tst-tlsmod11.so
446 $(objpfx)tst-tlsmod13a.so: $(objpfx)tst-tlsmod13.so
447 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
448 $(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so
449 $(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so
450 $(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so
451 $(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so
452 $(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so
453 $(objpfx)reldep9mod3.so: $(objpfx)reldep9mod1.so $(objpfx)reldep9mod2.so
454 $(objpfx)unload3mod1.so: $(objpfx)unload3mod3.so
455 $(objpfx)unload3mod2.so: $(objpfx)unload3mod3.so
456 $(objpfx)unload3mod3.so: $(objpfx)unload3mod4.so
457 $(objpfx)unload4mod1.so: $(objpfx)unload4mod2.so $(objpfx)unload4mod3.so
458 $(objpfx)unload4mod2.so: $(objpfx)unload4mod4.so $(objpfx)unload4mod3.so
459 $(objpfx)unload6mod1.so: $(libdl)
460 $(objpfx)unload6mod2.so: $(libdl)
461 $(objpfx)unload6mod3.so: $(libdl)
462 $(objpfx)unload7mod1.so: $(libdl)
463 $(objpfx)unload7mod2.so: $(objpfx)unload7mod1.so
465 LDFLAGS-tst-tlsmod5.so = -nostdlib
466 LDFLAGS-tst-tlsmod6.so = -nostdlib
468 testobj1.so-no-z-defs = yes
469 testobj3.so-no-z-defs = yes
470 testobj4.so-no-z-defs = yes
471 testobj5.so-no-z-defs = yes
472 testobj6.so-no-z-defs = yes
473 failobj.so-no-z-defs = yes
474 constload2.so-no-z-defs = yes
475 constload3.so-no-z-defs = yes
476 nodelmod1.so-no-z-defs = yes
477 nodelmod2.so-no-z-defs = yes
478 nodelmod4.so-no-z-defs = yes
479 nodel2mod2.so-no-z-defs = yes
480 reldepmod2.so-no-z-defs = yes
481 reldepmod3.so-no-z-defs = yes
482 reldepmod4.so-no-z-defs = yes
483 reldep4mod4.so-no-z-defs = yes
484 reldep4mod2.so-no-z-defs = yes
485 ltglobmod2.so-no-z-defs = yes
486 dblloadmod3.so-no-z-defs = yes
487 tst-tlsmod1.so-no-z-defs = yes
488 tst-tlsmod2.so-no-z-defs = yes
489 tst-tlsmod3.so-no-z-defs = yes
490 tst-tlsmod4.so-no-z-defs = yes
491 tst-tlsmod7.so-no-z-defs = yes
492 tst-tlsmod8.so-no-z-defs = yes
493 tst-tlsmod9.so-no-z-defs = yes
494 tst-tlsmod10.so-no-z-defs = yes
495 tst-tlsmod12.so-no-z-defs = yes
496 tst-tlsmod14a.so-no-z-defs = yes
497 tst-tlsmod14b.so-no-z-defs = yes
498 tst-tlsmod15a.so-no-z-defs = yes
499 tst-tlsmod16b.so-no-z-defs = yes
500 circlemod2.so-no-z-defs = yes
501 circlemod3.so-no-z-defs = yes
502 circlemod3a.so-no-z-defs = yes
503 reldep8mod2.so-no-z-defs = yes
504 reldep9mod1.so-no-z-defs = yes
505 unload3mod4.so-no-z-defs = yes
506 unload4mod1.so-no-z-defs = yes
508 ifeq ($(build-shared),yes)
509 # Build all the modules even when not actually running test programs.
510 tests: $(test-modules)
511 endif
513 $(objpfx)loadtest: $(libdl)
514 LDFLAGS-loadtest = -rdynamic
516 $(objpfx)loadtest.out: $(test-modules)
518 $(objpfx)neededtest: $(libdl)
519 $(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
520 $(objpfx)neededobj3.so
522 $(objpfx)neededtest2: $(libdl)
523 $(objpfx)neededtest2.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
524 $(objpfx)neededobj3.so
526 $(objpfx)neededtest3: $(libdl)
527 $(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
528 $(objpfx)neededobj3.so $(objpfx)neededobj4.so
530 neededtest4-ENV = LC_ALL=C LANGUAGE=C
531 $(objpfx)neededtest4: $(libdl) $(objpfx)neededobj1.so
532 $(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so
534 $(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so $(libdl)
535 LDFLAGS-restest1 = -rdynamic
537 $(objpfx)restest2: $(libdl)
538 LDFLAGS-restest2 = -rdynamic
540 $(objpfx)restest1.out: $(test-modules)
542 preloadtest-preloads = testobj1 testobj2 testobj3 testobj4 testobj5
543 $(objpfx)preloadtest: $(objpfx)testobj6.so
544 LDFLAGS-preloadtest = -rdynamic
545 $(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so)
546 preloadtest-ENV = \
547 LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so)))
549 $(objpfx)loadfail: $(libdl)
550 LDFLAGS-loadfail = -rdynamic
552 $(objpfx)loadfail.out: $(objpfx)failobj.so
554 $(objpfx)multiload: $(libdl)
555 LDFLAGS-multiload = -rdynamic
556 CFLAGS-multiload.c = -DOBJDIR=\"$(elf-objpfx)\"
558 $(objpfx)multiload.out: $(objpfx)testobj1.so
560 $(objpfx)origtest: $(libdl)
561 LDFLAGS-origtest = -rdynamic
562 $(objpfx)origtest.out: $(objpfx)testobj1.so
564 ifeq ($(have-thread-library),yes)
565 $(objpfx)resolvfail: $(libdl) $(shared-thread-library)
566 else
567 $(objpfx)resolvfail: $(libdl)
568 endif
570 $(objpfx)constload1: $(libdl)
571 $(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so
573 $(objpfx)circleload1: $(libdl)
574 $(objpfx)circleload1.out: $(objpfx)circlemod1.so \
575 $(objpfx)circlemod1a.so
577 $(objpfx)circlemod1.so: $(objpfx)circlemod2.so
578 $(objpfx)circlemod2.so: $(objpfx)circlemod3.so
579 $(objpfx)circlemod1a.so: $(objpfx)circlemod2a.so
580 $(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so
582 $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so)
584 $(objpfx)order.out: $(objpfx)order
585 $(elf-objpfx)$(rtld-installed-name) \
586 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
587 $(objpfx)order > $@
588 (echo "0123456789" | cmp $@ -) > /dev/null
590 $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so)
591 $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so)
592 vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so)
594 $(objpfx)noload: $(objpfx)testobj1.so
595 LDFLAGS-noload = -rdynamic
596 $(objpfx)noload.out: $(objpfx)testobj5.so
598 LDFLAGS-nodelete = -rdynamic
599 LDFLAGS-nodelmod1.so = -Wl,--enable-new-dtags,-z,nodelete
600 LDFLAGS-nodelmod4.so = -Wl,--enable-new-dtags,-z,nodelete
601 $(objpfx)nodelete: $(libdl)
602 $(objpfx)nodelete.out: $(objpfx)nodelmod1.so $(objpfx)nodelmod2.so \
603 $(objpfx)nodelmod3.so
605 LDFLAGS-nodlopenmod.so = -Wl,--enable-new-dtags,-z,nodlopen
606 $(objpfx)nodlopen: $(libdl)
607 $(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so
609 $(objpfx)nodlopenmod2.so: $(objpfx)nodlopenmod.so
610 $(objpfx)nodlopen2: $(libdl)
611 $(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so
613 $(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so
614 $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \
615 -L$(subst :, -L,$(rpath-link)) \
616 -Wl,-rpath-link=$(rpath-link) \
617 $< -Wl,-F,$(objpfx)filtmod2.so
618 $(objpfx)filter: $(objpfx)filtmod1.so
620 $(objpfx)unload: $(libdl)
621 $(objpfx)unload.out: $(objpfx)unloadmod.so
623 $(objpfx)reldep: $(libdl)
624 $(objpfx)reldep.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod2.so
626 $(objpfx)reldep2: $(libdl)
627 $(objpfx)reldep2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so
629 $(objpfx)reldep3: $(libdl)
630 $(objpfx)reldep3.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so
632 $(objpfx)reldep4: $(libdl)
633 $(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so
635 $(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so $(libdl)
637 $(objpfx)unload2: $(libdl)
638 $(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so
640 $(objpfx)lateglobal: $(libdl)
641 $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so
643 $(objpfx)tst-pathopt: $(libdl)
644 $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
645 $(objpfx)pathoptobj.so
646 $(SHELL) -e $< $(common-objpfx)
648 $(objpfx)initfirst: $(libdl)
649 $(objpfx)initfirst.out: $(objpfx)firstobj.so
651 $(objpfx)global: $(objpfx)globalmod1.so
652 $(objpfx)global.out: $(objpfx)reldepmod1.so
654 $(objpfx)dblload: $(libdl)
655 $(objpfx)dblload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so
657 $(objpfx)dblunload: $(libdl)
658 $(objpfx)dblunload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so
660 $(objpfx)reldep5: $(libdl)
661 $(objpfx)reldep5.out: $(objpfx)reldepmod5.so $(objpfx)reldepmod6.so
663 $(objpfx)reldep6: $(libdl)
664 $(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so
666 $(objpfx)reldep7: $(libdl)
667 $(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so
669 $(objpfx)reldep8: $(libdl)
670 $(objpfx)reldep8.out: $(objpfx)reldep8mod3.so
672 LDFLAGS-nodel2mod2.so = -Wl,--enable-new-dtags,-z,nodelete
673 $(objpfx)nodelete2: $(libdl)
674 $(objpfx)nodelete2.out: $(objpfx)nodel2mod3.so
676 $(objpfx)reldep9: $(libdl)
677 $(objpfx)reldep9.out: $(objpfx)reldep9mod3.so
679 $(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so
681 $(objpfx)tst-tls4: $(libdl)
682 $(objpfx)tst-tls4.out: $(objpfx)tst-tlsmod2.so
684 $(objpfx)tst-tls5: $(libdl)
685 $(objpfx)tst-tls5.out: $(objpfx)tst-tlsmod2.so
687 $(objpfx)tst-tls6: $(libdl)
688 $(objpfx)tst-tls6.out: $(objpfx)tst-tlsmod2.so
690 $(objpfx)tst-tls7: $(libdl)
691 $(objpfx)tst-tls7.out: $(objpfx)tst-tlsmod3.so
693 $(objpfx)tst-tls8: $(libdl)
694 $(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so
696 $(objpfx)tst-tls9: $(libdl)
697 $(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
699 $(objpfx)tst-tls10: $(objpfx)tst-tlsmod8.so
701 $(objpfx)tst-tls11: $(objpfx)tst-tlsmod10.so
703 $(objpfx)tst-tls12: $(objpfx)tst-tlsmod12.so
705 $(objpfx)tst-tls13: $(libdl)
706 $(objpfx)tst-tls13.out: $(objpfx)tst-tlsmod13a.so
708 $(objpfx)tst-tls14: $(objpfx)tst-tlsmod14a.so $(libdl)
709 $(objpfx)tst-tls14.out: $(objpfx)tst-tlsmod14b.so
711 $(objpfx)tst-tls15: $(libdl)
712 $(objpfx)tst-tls15.out: $(objpfx)tst-tlsmod15a.so $(objpfx)tst-tlsmod15b.so
714 $(objpfx)tst-tls-dlinfo: $(libdl)
715 $(objpfx)tst-tls-dlinfo.out: $(objpfx)tst-tlsmod2.so
719 $(objpfx)tst-tls16: $(libdl)
720 $(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so
722 $(objpfx)tst-tls17: $(libdl)
723 $(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so
724 $(patsubst %,$(objpfx)tst-tlsmod17a%.os,$(tlsmod17a-suffixes)): $(objpfx)tst-tlsmod17a%.os : tst-tlsmod17a.c
725 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ -DN=$* -DNOT_IN_libc=1 $<
726 $(patsubst %,$(objpfx)tst-tlsmod17a%.so,$(tlsmod17a-suffixes)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so
727 $(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)tst-tlsmod17a%.so,$(tlsmod17a-suffixes))
729 $(objpfx)tst-tls18: $(libdl)
730 $(objpfx)tst-tls18.out: $(patsubst %,$(objpfx)tst-tlsmod18a%.so,$(tlsmod18a-suffixes))
731 $(patsubst %,$(objpfx)tst-tlsmod18a%.os,$(tlsmod18a-suffixes)): $(objpfx)tst-tlsmod18a%.os : tst-tlsmod18a.c
732 $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ -DN=$* -DNOT_IN_libc=1 $<
733 $(patsubst %,$(objpfx)tst-tlsmod18a%.so,$(tlsmod18a-suffixes)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so
735 CFLAGS-tst-align.c = $(stack-align-test-flags)
736 CFLAGS-tst-align2.c = $(stack-align-test-flags)
737 CFLAGS-tst-alignmod.c = $(stack-align-test-flags)
738 CFLAGS-tst-alignmod2.c = $(stack-align-test-flags)
739 $(objpfx)tst-align: $(libdl)
740 $(objpfx)tst-align.out: $(objpfx)tst-alignmod.so
741 $(objpfx)tst-align2: $(objpfx)tst-alignmod2.so
743 $(objpfx)unload3: $(libdl)
744 $(objpfx)unload3.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \
745 $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so
747 $(objpfx)unload4: $(libdl)
748 $(objpfx)unload4.out: $(objpfx)unload4mod1.so $(objpfx)unload4mod3.so
750 $(objpfx)unload5: $(libdl)
751 $(objpfx)unload5.out: $(objpfx)unload3mod1.so $(objpfx)unload3mod2.so \
752 $(objpfx)unload3mod3.so $(objpfx)unload3mod4.so
754 $(objpfx)unload6: $(libdl)
755 $(objpfx)unload6.out: $(objpfx)unload6mod1.so $(objpfx)unload6mod2.so \
756 $(objpfx)unload6mod3.so
758 $(objpfx)unload7: $(libdl)
759 $(objpfx)unload7.out: $(objpfx)unload7mod1.so $(objpfx)unload7mod2.so
760 unload7-ENV = MALLOC_PERTURB_=85
762 ifdef libdl
763 $(objpfx)tst-tls9-static: $(common-objpfx)dlfcn/libdl.a
764 $(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
765 endif
767 ifeq ($(have-z-execstack),yes)
768 $(objpfx)tst-execstack: $(libdl)
769 $(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so
770 LDFLAGS-tst-execstack = -Wl,-z,noexecstack
771 LDFLAGS-tst-execstack-mod = -Wl,-z,execstack
773 $(objpfx)tst-execstack-needed: $(objpfx)tst-execstack-mod.so
774 LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack
776 LDFLAGS-tst-execstack-prog = -Wl,-z,execstack
777 endif
779 $(objpfx)tst-array1.out: $(objpfx)tst-array1
780 $(elf-objpfx)$(rtld-installed-name) \
781 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
782 $(objpfx)tst-array1 > $@
783 cmp $@ tst-array1.exp > /dev/null
785 $(objpfx)tst-array1-static.out: $(objpfx)tst-array1-static
786 $(objpfx)tst-array1-static > $@
787 cmp $@ tst-array1.exp > /dev/null
789 $(objpfx)tst-array2: $(objpfx)tst-array2dep.so
790 $(objpfx)tst-array2.out: $(objpfx)tst-array2
791 $(elf-objpfx)$(rtld-installed-name) \
792 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
793 $(objpfx)tst-array2 > $@
794 cmp $@ tst-array2.exp > /dev/null
796 $(objpfx)tst-array3.out: $(objpfx)tst-array3
797 $(elf-objpfx)$(rtld-installed-name) \
798 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
799 $(objpfx)tst-array3 > $@
800 cmp $@ tst-array1.exp > /dev/null
802 $(objpfx)tst-array4: $(libdl)
803 $(objpfx)tst-array4.out: $(objpfx)tst-array4 $(objpfx)tst-array2dep.so
804 $(elf-objpfx)$(rtld-installed-name) \
805 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
806 $< > $@
807 cmp $@ tst-array4.exp > /dev/null
809 $(objpfx)tst-array5: $(objpfx)tst-array5dep.so
810 $(objpfx)tst-array5.out: $(objpfx)tst-array5
811 $(elf-objpfx)$(rtld-installed-name) \
812 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
813 $(objpfx)tst-array5 > $@
814 cmp $@ tst-array5.exp > /dev/null
816 $(objpfx)tst-array5-static.out: $(objpfx)tst-array5-static
817 $(objpfx)tst-array5-static > $@
818 cmp $@ tst-array5-static.exp > /dev/null
820 ifeq (yesyes,$(have-fpie)$(build-shared))
821 CFLAGS-tst-pie1.c += $(pie-ccflag)
823 $(objpfx)tst-pie1.out: $(objpfx)tst-pie1
824 $(elf-objpfx)$(rtld-installed-name) \
825 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
826 $< > $@
828 $(objpfx)tst-pie1: $(objpfx)tst-pie1.o $(objpfx)tst-piemod1.so
829 $(LINK.o) -pie -Wl,-O1 \
830 $(sysdep-LDFLAGS) $(config-LDFLAGS) \
831 $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \
832 $(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
833 $(LDFLAGS) $(LDFLAGS-$(@F)) \
834 -L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \
835 -o $@ $(objpfx)tst-pie1.o $(objpfx)tst-piemod1.so \
836 $(common-objpfx)libc_nonshared.a
838 generated += tst-pie1 tst-pie1.out tst-pie1.o
839 endif
841 check-textrel-CFLAGS = -O -Wall -D_XOPEN_SOURCE=600 -D_BSD_SOURCE
842 $(objpfx)check-textrel: check-textrel.c
843 $(native-compile)
845 check-localplt-CFLAGS = -O -Wall -D_GNU_SOURCE -std=gnu99
846 $(objpfx)check-localplt: check-localplt.c
847 $(native-compile)
849 ifeq (yes,$(build-shared))
850 tests: $(objpfx)check-textrel.out
852 $(objpfx)check-textrel.out: $(objpfx)check-textrel
853 $(dir $<)$(notdir $<) $(common-objpfx)libc.so \
854 $(sort $(wildcard $(common-objpfx)*/lib*.so \
855 $(common-objpfx)iconvdata/*.so)) > $@
856 generated += check-textrel check-textrel.out
858 $(objpfx)tst-dlmodcount: $(libdl)
859 $(objpfx)tst-dlmodcount.out: $(test-modules)
861 check-data := $(firstword $(wildcard \
862 $(foreach D,$(add-ons) scripts,\
863 $(patsubst %,$(..)$D/data/localplt-%.data,\
864 $(abi-name) \
865 $(addsuffix -$(config-os),\
866 $(config-machine) \
867 $(base-machine)) \
868 generic))))
870 tests: $(objpfx)check-localplt.out
872 ifeq ($(have-thread-library),yes)
873 thread-dso := $(filter-out %_nonshared.a, $(shared-thread-library))
874 endif
876 $(objpfx)check-localplt.out: $(objpfx)check-localplt \
877 $(common-objpfx)libc.so \
878 $(common-objpfx)math/libm.so $(thread-dso) \
879 $(common-objpfx)rt/librt.so \
880 $(common-objpfx)dlfcn/libdl.so \
881 $(common-objpfx)resolv/libresolv.so \
882 $(common-objpfx)crypt/libcrypt.so \
883 $(check-data)
884 $(dir $<)$(notdir $<) $(filter-out $< $(check-data),$^) | \
885 LC_ALL=C sort | \
886 diff -u $(check-data) - > $@
887 endif
889 $(objpfx)tst-dlopenrpathmod.so: $(libdl)
890 $(objpfx)tst-dlopenrpath: $(objpfx)tst-dlopenrpathmod.so $(libdl)
891 CFLAGS-tst-dlopenrpath.c += -DPFX=\"$(objpfx)\"
892 LDFLAGS-tst-dlopenrpathmod.so += -Wl,-rpath,\$$ORIGIN/test-subdir
893 $(objpfx)tst-dlopenrpath.out: $(objpfx)firstobj.so
895 $(objpfx)tst-deep1mod2.so: $(objpfx)tst-deep1mod3.so
896 $(objpfx)tst-deep1: $(libdl) $(objpfx)tst-deep1mod1.so
897 $(objpfx)tst-deep1.out: $(objpfx)tst-deep1mod2.so
898 LDFLAGS-tst-deep1 += -rdynamic
899 tst-deep1mod3.so-no-z-defs = yes
901 $(objpfx)tst-dlmopen1mod.so: $(libdl)
902 $(objpfx)tst-dlmopen1: $(libdl)
903 $(objpfx)tst-dlmopen1.out: $(objpfx)tst-dlmopen1mod.so
905 $(objpfx)tst-dlmopen2: $(libdl)
906 $(objpfx)tst-dlmopen2.out: $(objpfx)tst-dlmopen1mod.so
908 $(objpfx)tst-dlmopen3: $(libdl)
909 $(objpfx)tst-dlmopen3.out: $(objpfx)tst-dlmopen1mod.so
911 $(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so
912 tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
914 $(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so
915 tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
917 $(objpfx)tst-global1: $(libdl)
918 $(objpfx)tst-global1.out: $(objpfx)testobj6.so $(objpfx)testobj2.so
920 $(objpfx)order2: $(libdl)
921 $(objpfx)order2.out: $(objpfx)order2 $(objpfx)order2mod1.so \
922 $(objpfx)order2mod2.so
923 $(elf-objpfx)$(rtld-installed-name) \
924 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
925 $(objpfx)order2 > $@
926 (echo "12345" | cmp $@ -) > /dev/null
927 $(objpfx)order2mod1.so: $(objpfx)order2mod4.so
928 $(objpfx)order2mod4.so: $(objpfx)order2mod3.so
929 $(objpfx)order2mod2.so: $(objpfx)order2mod3.so
930 order2mod2.so-no-z-defs = yes
932 tst-stackguard1-ARGS = --command "$(built-program-cmd) --child"
933 tst-stackguard1-static-ARGS = --command "$(objpfx)tst-stackguard1-static --child"
935 $(objpfx)tst-leaks1: $(libdl)
936 $(objpfx)tst-leaks1-mem: $(objpfx)tst-leaks1.out
937 $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks1.mtrace > $@
939 tst-leaks1-ENV = MALLOC_TRACE=$(objpfx)tst-leaks1.mtrace
941 $(objpfx)tst-addr1: $(libdl)
943 $(objpfx)tst-thrlock: $(libdl) $(shared-thread-library)