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
19 # Makefile for elf subdirectory of GNU C Library.
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
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 \
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 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 \
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-audit1.c tst-audit2.c tst-audit3.c \
93 tst-auditmod1.c tst-auditmod3a.c tst-auditmod3b.c \
94 order2mod1.c order2mod2.c order2mod3.c order2mod4.c \
95 tst-stackguard1.c tst-stackguard1-static.c \
96 tst-array5.c tst-array5-static.c tst-array5dep.c \
97 tst-array5.exp tst-leaks1.c check-execstack.c \
98 ifuncmain1.c ifuncmain1pic.c ifuncmain1vis.c \
99 ifuncmain1vispic.c ifuncmain1static.c \
100 ifuncmain1staticpic.c ifuncmain1picstatic.c \
101 ifuncdep1.c ifuncdep1pic.c ifuncmod1.c \
102 ifuncmain1pie.c ifuncmain1vispie.c \
103 ifuncmain1staticpie.c \
104 ifuncmain2.c ifuncmain2static.c ifuncdep2.c \
105 ifuncmain2pic.c ifuncmain2picstatic.c ifuncdep2pic.c \
106 ifuncmain3.c ifuncmod3.c \
107 ifuncmain4.c ifuncmain4static.c ifuncmain4picstatic.c \
108 ifuncmain5.c ifuncmain5pic.c ifuncmain5picstatic.c \
109 ifuncmain5pie.c ifuncmain5static.c \
110 ifuncmain5staticpic.c \
111 ifuncdep5.c ifuncdep5pic.c ifuncmod5.c \
112 ifuncmain6pie.c ifuncmod6.c \
113 ifuncmain7.c ifuncmain7pic.c ifuncmain7picstatic.c \
114 ifuncmain7pie.c ifuncmain7static.c \
115 tst-unique1.c tst-unique1mod1.c tst-unique1mod2.c \
116 tst-unique2.c tst-unique2mod1.c tst-unique2mod2.c
118 CFLAGS-dl-runtime.c
= -fexceptions
-fasynchronous-unwind-tables
119 CFLAGS-dl-lookup.c
= -fexceptions
-fasynchronous-unwind-tables
120 CFLAGS-dl-iterate-phdr.c
= $(uses-callbacks
)
122 include ..
/Makeconfig
124 ifeq ($(unwind-find-fde
),yes
)
125 routines
+= unwind-dw2-fde-glibc
126 shared-only-routines
+= unwind-dw2-fde-glibc
129 before-compile
= $(objpfx
)trusted-dirs.h
130 generated
:= trusted-dirs.h trusted-dirs.st for-renamed
/renamed.so
131 generated-dirs
:= for-renamed
133 ifeq ($(versioning
),yes
)
134 ld-map
= $(common-objpfx
)ld.map
137 ifeq (yes
,$(build-shared
))
138 extra-objs
= $(all-rtld-routines
:%=%.os
) soinit.os sofini.os interp.os
139 generated
+= librtld.os dl-allobjs.os
ld.so ldd
140 install-others
= $(inst_slibdir
)/$(rtld-installed-name
)
141 install-bin-script
= ldd
147 install-rootsbin
= sln
149 ifeq (yes
,$(use-ldconfig
))
150 ifeq (yes
,$(build-shared
))
151 others-static
+= ldconfig
153 install-rootsbin
+= ldconfig
155 ldconfig-modules
:= cache readlib xmalloc xstrdup chroot_canon
156 extra-objs
+= $(ldconfig-modules
:=.o
)
158 # To find xmalloc.c and xstrdup.c
159 vpath
%.c ..
/locale
/programs
164 tests
= tst-tls1 tst-tls2 tst-tls9 tst-leaks1
165 ifeq (yes
,$(have-initfini-array
))
166 tests
+= tst-array1 tst-array2 tst-array3 tst-array4 tst-array5
168 ifeq (yes
,$(build-static
))
169 tests-static
= tst-tls1-static tst-tls2-static tst-stackguard1-static
170 ifeq (yesyesyes
,$(build-static
)$(build-shared
)$(elf
))
171 tests-static
+= tst-tls9-static
172 tst-tls9-static-ENV
= \
173 LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
):$(common-objpfx
)dlfcn
175 ifeq (yes
,$(have-initfini-array
))
176 tests-static
+= tst-array1-static tst-array5-static
178 tests
+= $(tests-static
)
180 ifeq (yes
,$(build-shared
))
181 tests
+= loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
182 constload1 order vismain noload
filter unload \
183 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
184 nodlopen nodlopen2 neededtest neededtest2 \
185 neededtest3 neededtest4 unload2 lateglobal initfirst global \
186 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
187 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
188 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
189 tst-tls16 tst-tls17 tst-tls18 tst-tls-dlinfo \
190 tst-align tst-align2
$(tests-execstack-
$(have-z-execstack
)) \
191 tst-dlmodcount tst-dlopenrpath tst-deep1 \
192 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
193 unload3 unload4 unload5 unload6 unload7 tst-global1 order2 \
194 tst-audit1 tst-audit2 \
195 tst-stackguard1 tst-addr1 tst-thrlock \
196 tst-unique1 tst-unique2
198 test-srcs
= tst-pathopt
199 tests-execstack-yes
= tst-execstack tst-execstack-needed tst-execstack-prog
200 ifeq (x86_64
,$(config-machine
))
204 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
205 tests
: $(objpfx
)tst-pie1.out
207 tests
: $(objpfx
)tst-leaks1-mem
208 tlsmod17a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
209 tlsmod18a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
210 modules-names
= testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
211 testobj1_1 failobj constload2 constload3 unloadmod \
212 dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
213 nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
214 nodel2mod1 nodel2mod2 nodel2mod3 \
215 nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
216 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
217 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
218 neededobj1 neededobj2 neededobj3 neededobj4 \
219 neededobj5 neededobj6 firstobj globalmod1 \
220 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \
221 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \
222 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \
223 reldep7mod1 reldep7mod2 \
224 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \
225 tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
226 tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
227 tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
228 tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
229 $(patsubst %,tst-tlsmod17a
%,$(tlsmod17a-suffixes
)) \
231 $(patsubst %,tst-tlsmod18a
%,$(tlsmod18a-suffixes
)) \
232 circlemod1 circlemod1a circlemod2 circlemod2a \
233 circlemod3 circlemod3a \
234 reldep8mod1 reldep8mod2 reldep8mod3 \
235 reldep9mod1 reldep9mod2 reldep9mod3 \
236 tst-alignmod tst-alignmod2 \
237 $(modules-execstack-
$(have-z-execstack
)) \
238 tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \
239 tst-dlmopen1mod tst-auditmod1 \
240 tst-auditmod3a tst-auditmod3b \
241 unload3mod1 unload3mod2 unload3mod3 unload3mod4 \
242 unload4mod1 unload4mod2 unload4mod3 unload4mod4 \
243 unload6mod1 unload6mod2 unload6mod3 \
244 unload7mod1 unload7mod2 \
245 order2mod1 order2mod2 order2mod3 order2mod4 \
246 tst-unique1mod1 tst-unique1mod2 \
247 tst-unique2mod1 tst-unique2mod2
248 ifeq (yes
,$(have-initfini-array
))
249 modules-names
+= tst-array2dep tst-array5dep
251 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
252 modules-names
+= tst-piemod1
254 modules-execstack-yes
= tst-execstack-mod
255 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
256 # We need this variable to be sure the test modules get the right CPPFLAGS.
257 test-extras
+= $(modules-names
)
259 # filtmod1.so has a special rule
260 modules-names-nobuild
:= filtmod1
262 ifeq (yes
,$(multi-arch
))
263 tests-static
+= ifuncmain1static ifuncmain1picstatic \
264 ifuncmain2static ifuncmain2picstatic \
265 ifuncmain4static ifuncmain4picstatic \
266 ifuncmain5static ifuncmain5picstatic \
267 ifuncmain7static ifuncmain7picstatic
269 ifeq (yes
,$(build-shared
))
270 tests
+= ifuncmain1 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \
271 ifuncmain1staticpic \
272 ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \
273 ifuncmain5 ifuncmain5pic ifuncmain5staticpic \
274 ifuncmain7 ifuncmain7pic
275 ifeq (yes
,$(have-fpie
))
276 tests
: $(objpfx
)ifuncmain1pie.out
$(objpfx
)ifuncmain1vispie.out \
277 $(objpfx
)ifuncmain1staticpie.out
$(objpfx
)ifuncmain5pie.out \
278 $(objpfx
)ifuncmain6pie.out
$(objpfx
)ifuncmain7pie.out
280 modules-names
+= ifuncmod1 ifuncmod3 ifuncmod5 ifuncmod6
287 check-abi
: check-abi-ld
288 update-abi
: update-abi-ld
290 ifeq (yes
,$(build-shared
))
291 # Make sure these things are built in the `make lib' pass so they can be used
292 # to run programs during the `make others' pass.
293 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
294 $(addprefix $(objpfx
),$(extra-objs
))
297 # Command to link into a larger single relocatable object.
298 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
300 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
301 $(reloc-link
) -o
$@
$^
303 # Link together the dynamic linker into a single relocatable object.
304 # First we do a link against libc_pic.a just to get a link map,
305 # and discard the object produced by that link. From the link map
306 # we can glean all the libc modules that need to go into the dynamic
307 # linker. Then we do a recursive make that goes into all the subdirs
308 # those modules come from and builds special rtld-foo.os versions that
309 # are compiled with special flags, and puts these modules into rtld-libc.a
310 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
312 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
314 $(reloc-link
) -o
$@.o
'-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
318 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
320 sed
-n
's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
322 while read lib file
; do \
325 LC_ALL
=C fgrep
-l
/$$file \
326 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
328 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
331 echo rtld-
$${lib
%%/*} += $$file ;; \
332 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
335 echo rtld-subdirs
= `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
336 | LC_ALL=C sort -u` >> $@T
339 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
340 $(MAKE
) -f
$< -f rtld-Rules
342 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
343 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)' \
346 generated
+= librtld.map librtld.mk rtld-libc.a librtld.os.map
348 z-now-yes
= -Wl
,-z
,now
350 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
352 $(LINK.o
) -nostdlib
-nostartfiles
-shared
$(z-now-
$(bind-now
)) \
353 $(LDFLAGS-rtld
) -Wl
,-z
,defs
-Wl
,--verbose
2>&1 | \
355 sed
-e
'/^=========/,/^=========/!d;/^=========/d' \
356 -e
's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
358 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@ \
359 $(LDFLAGS-rtld
) -Wl
,-z
,defs
$(z-now-
$(bind-now
)) \
360 $(filter-out $(map-file
),$^
) $(load-map-file
) \
361 -Wl
,-soname
=$(rtld-installed-name
) -T
$@.lds
364 |
$(AWK
) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
366 # interp.c exists just to get this string into the libraries.
367 CFLAGS-interp.c
= -D
'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \
369 $(objpfx
)interp.os
: $(common-objpfx
)config.make
371 ifneq (ld.so
,$(rtld-installed-name
))
372 # Make sure ld.so.1 exists in the build directory so we can link
374 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
377 generated
+= $(rtld-installed-name
)
380 # Build a file mentioning all trustworthy directories to look for shared
381 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
382 # add directories to the list by defining $(user-defined-trusted-dirs)
383 # before starting make.
384 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
385 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
386 $(make-target-directory
)
387 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
388 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
389 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
390 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
392 CPPFLAGS-dl-load.c
= -I
$(objpfx
).
-I
$(csu-objpfx
).
394 ifeq (yes
,$(build-shared
))
395 $(inst_slibdir
)/$(rtld-version-installed-name
): $(objpfx
)ld.so
$(+force)
396 $(make-target-directory
)
397 $(do-install-program
)
399 $(inst_slibdir
)/$(rtld-installed-name
): \
400 $(inst_slibdir
)/$(rtld-version-installed-name
) \
401 $(inst_slibdir
)/libc-
$(version
).so
404 # Special target called by parent to install just the dynamic linker.
406 ldso_install
: $(inst_slibdir
)/$(rtld-installed-name
)
410 common-ldd-rewrite
= -e
's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
411 -e
's%@VERSION@%$(version)%g'
412 sh-ldd-rewrite
= $(common-ldd-rewrite
) -e
's%@BASH@%/bin/sh%g;s/\$$"/"/g'
413 bash-ldd-rewrite
= $(common-ldd-rewrite
) -e
's%@BASH@%$(BASH)%g' \
414 -e
's%@TEXTDOMAINDIR@%$(msgcatdir)%g'
416 ifneq ($(have-bash2
),yes
)
422 ifeq ($(ldd-rewrite-script
),no
)
424 LC_ALL
=C sed
$($(ldd-shell
)-ldd-rewrite
) < $< > $@.new
428 LC_ALL
=C sed
$($(ldd-shell
)-ldd-rewrite
) < $< | LC_ALL
=C sed
-f
$(ldd-rewrite-script
) > $@.new
432 $(objpfx
)ldd
: ldd.bash.in
$(common-objpfx
)soversions.mk \
433 $(common-objpfx
)config.make
438 $(objpfx
)sprof
: $(libdl
)
440 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
441 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
442 CFLAGS-ldconfig.c
= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' \
443 -D
'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig
=1
444 CFLAGS-dl-cache.c
= $(SYSCONF-FLAGS
)
445 CFLAGS-cache.c
= $(SYSCONF-FLAGS
)
447 CPPFLAGS-.os
+= $(if
$(filter $(@F
),$(patsubst %,%.os
,$(all-rtld-routines
))),-DNOT_IN_libc
=1 -DIS_IN_rtld
=1)
449 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
450 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
452 ifeq (yes
,$(build-shared
))
453 ifeq ($(cross-compiling
),no
)
454 tests
: $(objpfx
)tst-pathopt.out
458 $(objpfx
)testobj1.so
: $(libdl
)
459 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
$(libdl
)
460 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
$(libdl
)
461 $(objpfx
)testobj3.so
: $(libdl
)
462 $(objpfx
)testobj4.so
: $(libdl
)
463 $(objpfx
)testobj5.so
: $(libdl
)
464 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
$(libdl
)
465 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
466 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
467 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
468 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
469 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
470 $(objpfx
)nextmod1.so
: $(libdl
)
471 $(objpfx
)neededobj1.so
: $(libdl
)
472 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
$(libdl
)
473 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
$(libdl
)
474 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
475 $(objpfx
)neededobj3.so
$(libdl
)
476 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
477 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
478 $(objpfx
)ltglobmod2.so
: $(libdl
)
479 $(objpfx
)firstobj.so
: $(shared-thread-library
)
480 $(objpfx
)globalmod1.so
: $(libdl
)
481 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
482 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
483 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
484 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
485 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
486 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
487 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
488 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
489 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
490 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
491 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
492 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
493 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
494 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
495 $(objpfx
)tst-tlsmod13a.so
: $(objpfx
)tst-tlsmod13.so
496 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
497 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
498 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
499 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
500 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
501 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
502 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
503 $(objpfx
)unload3mod1.so
: $(objpfx
)unload3mod3.so
504 $(objpfx
)unload3mod2.so
: $(objpfx
)unload3mod3.so
505 $(objpfx
)unload3mod3.so
: $(objpfx
)unload3mod4.so
506 $(objpfx
)unload4mod1.so
: $(objpfx
)unload4mod2.so
$(objpfx
)unload4mod3.so
507 $(objpfx
)unload4mod2.so
: $(objpfx
)unload4mod4.so
$(objpfx
)unload4mod3.so
508 $(objpfx
)unload6mod1.so
: $(libdl
)
509 $(objpfx
)unload6mod2.so
: $(libdl
)
510 $(objpfx
)unload6mod3.so
: $(libdl
)
511 $(objpfx
)unload7mod1.so
: $(libdl
)
512 $(objpfx
)unload7mod2.so
: $(objpfx
)unload7mod1.so
514 LDFLAGS-tst-tlsmod5.so
= -nostdlib
515 LDFLAGS-tst-tlsmod6.so
= -nostdlib
517 testobj1.so-no-z-defs
= yes
518 testobj3.so-no-z-defs
= yes
519 testobj4.so-no-z-defs
= yes
520 testobj5.so-no-z-defs
= yes
521 testobj6.so-no-z-defs
= yes
522 failobj.so-no-z-defs
= yes
523 constload2.so-no-z-defs
= yes
524 constload3.so-no-z-defs
= yes
525 nodelmod1.so-no-z-defs
= yes
526 nodelmod2.so-no-z-defs
= yes
527 nodelmod4.so-no-z-defs
= yes
528 nodel2mod2.so-no-z-defs
= yes
529 reldepmod2.so-no-z-defs
= yes
530 reldepmod3.so-no-z-defs
= yes
531 reldepmod4.so-no-z-defs
= yes
532 reldep4mod4.so-no-z-defs
= yes
533 reldep4mod2.so-no-z-defs
= yes
534 ltglobmod2.so-no-z-defs
= yes
535 dblloadmod3.so-no-z-defs
= yes
536 tst-tlsmod1.so-no-z-defs
= yes
537 tst-tlsmod2.so-no-z-defs
= yes
538 tst-tlsmod3.so-no-z-defs
= yes
539 tst-tlsmod4.so-no-z-defs
= yes
540 tst-tlsmod7.so-no-z-defs
= yes
541 tst-tlsmod8.so-no-z-defs
= yes
542 tst-tlsmod9.so-no-z-defs
= yes
543 tst-tlsmod10.so-no-z-defs
= yes
544 tst-tlsmod12.so-no-z-defs
= yes
545 tst-tlsmod14a.so-no-z-defs
= yes
546 tst-tlsmod14b.so-no-z-defs
= yes
547 tst-tlsmod15a.so-no-z-defs
= yes
548 tst-tlsmod16b.so-no-z-defs
= yes
549 circlemod2.so-no-z-defs
= yes
550 circlemod3.so-no-z-defs
= yes
551 circlemod3a.so-no-z-defs
= yes
552 reldep8mod2.so-no-z-defs
= yes
553 reldep9mod1.so-no-z-defs
= yes
554 unload3mod4.so-no-z-defs
= yes
555 unload4mod1.so-no-z-defs
= yes
556 ifuncmod1.so-no-z-defs
= yes
557 ifuncmod5.so-no-z-defs
= yes
558 ifuncmod6.so-no-z-defs
= yes
560 ifeq ($(build-shared
),yes
)
561 # Build all the modules even when not actually running test programs.
562 tests
: $(test-modules
)
565 $(objpfx
)loadtest
: $(libdl
)
566 LDFLAGS-loadtest
= -rdynamic
568 $(objpfx
)loadtest.out
: $(test-modules
)
570 $(objpfx
)neededtest
: $(libdl
)
571 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
572 $(objpfx
)neededobj3.so
574 $(objpfx
)neededtest2
: $(libdl
)
575 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
576 $(objpfx
)neededobj3.so
578 $(objpfx
)neededtest3
: $(libdl
)
579 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
580 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
582 neededtest4-ENV
= LC_ALL
=C LANGUAGE
=C
583 $(objpfx
)neededtest4
: $(libdl
) $(objpfx
)neededobj1.so
584 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
586 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
$(libdl
)
587 LDFLAGS-restest1
= -rdynamic
589 $(objpfx
)restest2
: $(libdl
)
590 LDFLAGS-restest2
= -rdynamic
592 $(objpfx
)restest1.out
: $(test-modules
)
594 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
595 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
596 LDFLAGS-preloadtest
= -rdynamic
597 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
599 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
601 $(objpfx
)loadfail
: $(libdl
)
602 LDFLAGS-loadfail
= -rdynamic
604 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
606 $(objpfx
)multiload
: $(libdl
)
607 LDFLAGS-multiload
= -rdynamic
608 CFLAGS-multiload.c
= -DOBJDIR
=\"$(elf-objpfx
)\"
610 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
612 $(objpfx
)origtest
: $(libdl
)
613 LDFLAGS-origtest
= -rdynamic
614 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
616 ifeq ($(have-thread-library
),yes
)
617 $(objpfx
)resolvfail
: $(libdl
) $(shared-thread-library
)
619 $(objpfx
)resolvfail
: $(libdl
)
622 $(objpfx
)constload1
: $(libdl
)
623 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
625 $(objpfx
)circleload1
: $(libdl
)
626 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
627 $(objpfx
)circlemod1a.so
629 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
630 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
631 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
632 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
634 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
636 $(objpfx
)order.out
: $(objpfx
)order
637 $(elf-objpfx
)$(rtld-installed-name
) \
638 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
640 (echo
"0123456789" | cmp
$@
-) > /dev
/null
642 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
643 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
644 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
646 $(objpfx
)noload
: $(objpfx
)testobj1.so
647 LDFLAGS-noload
= -rdynamic
648 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
650 LDFLAGS-nodelete
= -rdynamic
651 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
652 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
653 $(objpfx
)nodelete
: $(libdl
)
654 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
655 $(objpfx
)nodelmod3.so
657 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
658 $(objpfx
)nodlopen
: $(libdl
)
659 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
661 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
662 $(objpfx
)nodlopen2
: $(libdl
)
663 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
665 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
666 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
667 -L
$(subst :, -L
,$(rpath-link
)) \
668 -Wl
,-rpath-link
=$(rpath-link
) \
669 $< -Wl
,-F
,$(objpfx
)filtmod2.so
670 $(objpfx
)filter: $(objpfx
)filtmod1.so
672 $(objpfx
)unload
: $(libdl
)
673 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
675 $(objpfx
)reldep
: $(libdl
)
676 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
678 $(objpfx
)reldep2
: $(libdl
)
679 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
681 $(objpfx
)reldep3
: $(libdl
)
682 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
684 $(objpfx
)reldep4
: $(libdl
)
685 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
687 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
$(libdl
)
689 $(objpfx
)unload2
: $(libdl
)
690 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
692 $(objpfx
)lateglobal
: $(libdl
)
693 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
695 $(objpfx
)tst-pathopt
: $(libdl
)
696 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
697 $(objpfx
)pathoptobj.so
698 $(SHELL
) -e
$< $(common-objpfx
)
700 $(objpfx
)initfirst
: $(libdl
)
701 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
703 $(objpfx
)global
: $(objpfx
)globalmod1.so
704 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
706 $(objpfx
)dblload
: $(libdl
)
707 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
709 $(objpfx
)dblunload
: $(libdl
)
710 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
712 $(objpfx
)reldep5
: $(libdl
)
713 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod6.so
715 $(objpfx
)reldep6
: $(libdl
)
716 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
718 $(objpfx
)reldep7
: $(libdl
)
719 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
721 $(objpfx
)reldep8
: $(libdl
)
722 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
724 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
725 $(objpfx
)nodelete2
: $(libdl
)
726 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
728 $(objpfx
)reldep9
: $(libdl
)
729 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
731 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
733 $(objpfx
)tst-tls4
: $(libdl
)
734 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
736 $(objpfx
)tst-tls5
: $(libdl
)
737 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
739 $(objpfx
)tst-tls6
: $(libdl
)
740 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
742 $(objpfx
)tst-tls7
: $(libdl
)
743 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
745 $(objpfx
)tst-tls8
: $(libdl
)
746 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
748 $(objpfx
)tst-tls9
: $(libdl
)
749 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
751 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
753 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
755 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
757 $(objpfx
)tst-tls13
: $(libdl
)
758 $(objpfx
)tst-tls13.out
: $(objpfx
)tst-tlsmod13a.so
760 $(objpfx
)tst-tls14
: $(objpfx
)tst-tlsmod14a.so
$(libdl
)
761 $(objpfx
)tst-tls14.out
: $(objpfx
)tst-tlsmod14b.so
763 $(objpfx
)tst-tls15
: $(libdl
)
764 $(objpfx
)tst-tls15.out
: $(objpfx
)tst-tlsmod15a.so
$(objpfx
)tst-tlsmod15b.so
766 $(objpfx
)tst-tls-dlinfo
: $(libdl
)
767 $(objpfx
)tst-tls-dlinfo.out
: $(objpfx
)tst-tlsmod2.so
771 $(objpfx
)tst-tls16
: $(libdl
)
772 $(objpfx
)tst-tls16.out
: $(objpfx
)tst-tlsmod16a.so
$(objpfx
)tst-tlsmod16b.so
774 $(objpfx
)tst-tls17
: $(libdl
)
775 $(objpfx
)tst-tls17.out
: $(objpfx
)tst-tlsmod17b.so
776 $(patsubst %,$(objpfx
)tst-tlsmod17a
%.os
,$(tlsmod17a-suffixes
)): $(objpfx
)tst-tlsmod17a
%.os
: tst-tlsmod17a.c
777 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -c
-o
$@
-DN
=$* -DNOT_IN_libc
=1 $<
778 $(patsubst %,$(objpfx
)tst-tlsmod17a
%.so
,$(tlsmod17a-suffixes
)): $(objpfx
)tst-tlsmod17a
%.so
: $(objpfx
)ld.so
779 $(objpfx
)tst-tlsmod17b.so
: $(patsubst %,$(objpfx
)tst-tlsmod17a
%.so
,$(tlsmod17a-suffixes
))
781 $(objpfx
)tst-tls18
: $(libdl
)
782 $(objpfx
)tst-tls18.out
: $(patsubst %,$(objpfx
)tst-tlsmod18a
%.so
,$(tlsmod18a-suffixes
))
783 $(patsubst %,$(objpfx
)tst-tlsmod18a
%.os
,$(tlsmod18a-suffixes
)): $(objpfx
)tst-tlsmod18a
%.os
: tst-tlsmod18a.c
784 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -c
-o
$@
-DN
=$* -DNOT_IN_libc
=1 $<
785 $(patsubst %,$(objpfx
)tst-tlsmod18a
%.so
,$(tlsmod18a-suffixes
)): $(objpfx
)tst-tlsmod18a
%.so
: $(objpfx
)ld.so
787 CFLAGS-tst-align.c
= $(stack-align-test-flags
)
788 CFLAGS-tst-align2.c
= $(stack-align-test-flags
)
789 CFLAGS-tst-alignmod.c
= $(stack-align-test-flags
)
790 CFLAGS-tst-alignmod2.c
= $(stack-align-test-flags
)
791 $(objpfx
)tst-align
: $(libdl
)
792 $(objpfx
)tst-align.out
: $(objpfx
)tst-alignmod.so
793 $(objpfx
)tst-align2
: $(objpfx
)tst-alignmod2.so
795 $(objpfx
)unload3
: $(libdl
)
796 $(objpfx
)unload3.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
797 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
799 $(objpfx
)unload4
: $(libdl
)
800 $(objpfx
)unload4.out
: $(objpfx
)unload4mod1.so
$(objpfx
)unload4mod3.so
802 $(objpfx
)unload5
: $(libdl
)
803 $(objpfx
)unload5.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
804 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
806 $(objpfx
)unload6
: $(libdl
)
807 $(objpfx
)unload6.out
: $(objpfx
)unload6mod1.so
$(objpfx
)unload6mod2.so \
808 $(objpfx
)unload6mod3.so
810 $(objpfx
)unload7
: $(libdl
)
811 $(objpfx
)unload7.out
: $(objpfx
)unload7mod1.so
$(objpfx
)unload7mod2.so
812 unload7-ENV
= MALLOC_PERTURB_
=85
815 $(objpfx
)tst-tls9-static
: $(common-objpfx
)dlfcn
/libdl.a
816 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
819 ifeq ($(have-z-execstack
),yes
)
820 $(objpfx
)tst-execstack
: $(libdl
)
821 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
822 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
823 LDFLAGS-tst-execstack-mod
= -Wl
,-z
,execstack
825 $(objpfx
)tst-execstack-needed
: $(objpfx
)tst-execstack-mod.so
826 LDFLAGS-tst-execstack-needed
= -Wl
,-z
,noexecstack
828 LDFLAGS-tst-execstack-prog
= -Wl
,-z
,execstack
831 $(objpfx
)tst-array1.out
: $(objpfx
)tst-array1
832 $(elf-objpfx
)$(rtld-installed-name
) \
833 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
834 $(objpfx
)tst-array1
> $@
835 cmp
$@ tst-array1.exp
> /dev
/null
837 $(objpfx
)tst-array1-static.out
: $(objpfx
)tst-array1-static
838 $(objpfx
)tst-array1-static
> $@
839 cmp
$@ tst-array1.exp
> /dev
/null
841 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
842 $(objpfx
)tst-array2.out
: $(objpfx
)tst-array2
843 $(elf-objpfx
)$(rtld-installed-name
) \
844 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
845 $(objpfx
)tst-array2
> $@
846 cmp
$@ tst-array2.exp
> /dev
/null
848 $(objpfx
)tst-array3.out
: $(objpfx
)tst-array3
849 $(elf-objpfx
)$(rtld-installed-name
) \
850 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
851 $(objpfx
)tst-array3
> $@
852 cmp
$@ tst-array1.exp
> /dev
/null
854 $(objpfx
)tst-array4
: $(libdl
)
855 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array4
$(objpfx
)tst-array2dep.so
856 $(elf-objpfx
)$(rtld-installed-name
) \
857 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
859 cmp
$@ tst-array4.exp
> /dev
/null
861 $(objpfx
)tst-array5
: $(objpfx
)tst-array5dep.so
862 $(objpfx
)tst-array5.out
: $(objpfx
)tst-array5
863 $(elf-objpfx
)$(rtld-installed-name
) \
864 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
865 $(objpfx
)tst-array5
> $@
866 cmp
$@ tst-array5.exp
> /dev
/null
868 $(objpfx
)tst-array5-static.out
: $(objpfx
)tst-array5-static
869 $(objpfx
)tst-array5-static
> $@
870 cmp
$@ tst-array5-static.exp
> /dev
/null
872 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
873 CFLAGS-tst-pie1.c
+= $(pie-ccflag
)
875 $(objpfx
)tst-pie1.out
: $(objpfx
)tst-pie1
876 $(elf-objpfx
)$(rtld-installed-name
) \
877 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
880 $(objpfx
)tst-pie1
: $(objpfx
)tst-pie1.o
$(objpfx
)tst-piemod1.so
883 generated
+= tst-pie1 tst-pie1.out tst-pie1.o
886 check-textrel-CFLAGS
= -O
-Wall
-D_XOPEN_SOURCE
=600 -D_BSD_SOURCE
887 $(objpfx
)check-textrel
: check-textrel.c
890 check-execstack-CFLAGS
= -O
-Wall
-D_XOPEN_SOURCE
=600 -D_BSD_SOURCE
-std
=gnu99
891 $(objpfx
)check-execstack
: check-execstack.c
894 check-localplt-CFLAGS
= -O
-Wall
-D_GNU_SOURCE
-std
=gnu99
895 $(objpfx
)check-localplt
: check-localplt.c
898 ifeq (yes
,$(build-shared
))
899 tests
: $(objpfx
)check-textrel.out
$(objpfx
)check-execstack.out
901 $(objpfx
)check-textrel.out
: $(objpfx
)check-textrel
902 $(dir $<)$(notdir $<) $(common-objpfx
)libc.so \
903 $(sort $(wildcard $(common-objpfx
)*/lib
*.so \
904 $(common-objpfx
)iconvdata
/*.so
)) > $@
905 generated
+= check-textrel check-textrel.out
907 $(objpfx
)check-execstack.out
: $(objpfx
)check-execstack
908 $(dir $<)$(notdir $<) $(common-objpfx
)libc.so \
909 $(sort $(wildcard $(common-objpfx
)*/lib
*.so \
910 $(common-objpfx
)iconvdata
/*.so
)) > $@
911 generated
+= check-execstack check-execstack.out
913 $(objpfx
)tst-dlmodcount
: $(libdl
)
914 $(objpfx
)tst-dlmodcount.out
: $(test-modules
)
916 check-data
:= $(firstword $(wildcard \
917 $(foreach D
,$(add-ons
) scripts
,\
918 $(patsubst %,$(..
)$D/data
/localplt-
%.data
,\
920 $(addsuffix -$(config-os
),\
925 tests
: $(objpfx
)check-localplt.out
927 ifeq ($(have-thread-library
),yes
)
928 thread-dso
:= $(filter-out %_nonshared.a
, $(shared-thread-library
))
931 $(objpfx
)check-localplt.out
: $(objpfx
)check-localplt \
932 $(common-objpfx
)libc.so \
933 $(common-objpfx
)math
/libm.so
$(thread-dso
) \
934 $(common-objpfx
)rt
/librt.so \
935 $(common-objpfx
)dlfcn
/libdl.so \
936 $(common-objpfx
)resolv
/libresolv.so \
937 $(common-objpfx
)crypt
/libcrypt.so \
939 $(dir $<)$(notdir $<) $(filter-out $< $(check-data
),$^
) | \
941 diff
-u
$(check-data
) - > $@
944 $(objpfx
)tst-dlopenrpathmod.so
: $(libdl
)
945 $(objpfx
)tst-dlopenrpath
: $(objpfx
)tst-dlopenrpathmod.so
$(libdl
)
946 CFLAGS-tst-dlopenrpath.c
+= -DPFX
=\"$(objpfx
)\"
947 LDFLAGS-tst-dlopenrpathmod.so
+= -Wl
,-rpath
,\
$$ORIGIN/test-subdir
948 $(objpfx
)tst-dlopenrpath.out
: $(objpfx
)firstobj.so
950 $(objpfx
)tst-deep1mod2.so
: $(objpfx
)tst-deep1mod3.so
951 $(objpfx
)tst-deep1
: $(libdl
) $(objpfx
)tst-deep1mod1.so
952 $(objpfx
)tst-deep1.out
: $(objpfx
)tst-deep1mod2.so
953 LDFLAGS-tst-deep1
+= -rdynamic
954 tst-deep1mod3.so-no-z-defs
= yes
956 $(objpfx
)tst-dlmopen1mod.so
: $(libdl
)
957 $(objpfx
)tst-dlmopen1
: $(libdl
)
958 $(objpfx
)tst-dlmopen1.out
: $(objpfx
)tst-dlmopen1mod.so
960 $(objpfx
)tst-dlmopen2
: $(libdl
)
961 $(objpfx
)tst-dlmopen2.out
: $(objpfx
)tst-dlmopen1mod.so
963 $(objpfx
)tst-dlmopen3
: $(libdl
)
964 $(objpfx
)tst-dlmopen3.out
: $(objpfx
)tst-dlmopen1mod.so
966 $(objpfx
)tst-audit1.out
: $(objpfx
)tst-auditmod1.so
967 tst-audit1-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
969 $(objpfx
)tst-audit2.out
: $(objpfx
)tst-auditmod1.so
970 tst-audit2-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
972 $(objpfx
)tst-audit3
: $(objpfx
)tst-auditmod3a.so
973 $(objpfx
)tst-audit3.out
: $(objpfx
)tst-auditmod3b.so
974 tst-audit3-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod3b.so
976 $(objpfx
)tst-global1
: $(libdl
)
977 $(objpfx
)tst-global1.out
: $(objpfx
)testobj6.so
$(objpfx
)testobj2.so
979 $(objpfx
)order2
: $(libdl
)
980 $(objpfx
)order2.out
: $(objpfx
)order2
$(objpfx
)order2mod1.so \
981 $(objpfx
)order2mod2.so
982 $(elf-objpfx
)$(rtld-installed-name
) \
983 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
985 (echo
"12345" | cmp
$@
-) > /dev
/null
986 $(objpfx
)order2mod1.so
: $(objpfx
)order2mod4.so
987 $(objpfx
)order2mod4.so
: $(objpfx
)order2mod3.so
988 $(objpfx
)order2mod2.so
: $(objpfx
)order2mod3.so
989 order2mod2.so-no-z-defs
= yes
991 tst-stackguard1-ARGS
= --command
"$(built-program-cmd) --child"
992 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
994 $(objpfx
)tst-leaks1
: $(libdl
)
995 $(objpfx
)tst-leaks1-mem
: $(objpfx
)tst-leaks1.out
996 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1.mtrace
> $@
998 tst-leaks1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1.mtrace
1000 $(objpfx
)tst-addr1
: $(libdl
)
1002 $(objpfx
)tst-thrlock
: $(libdl
) $(shared-thread-library
)
1004 CFLAGS-ifuncmain1pic.c
+= $(pic-ccflag
)
1005 CFLAGS-ifuncmain1picstatic.c
+= $(pic-ccflag
)
1006 CFLAGS-ifuncmain1staticpic.c
+= $(pic-ccflag
)
1007 CFLAGS-ifuncdep1pic.c
+= $(pic-ccflag
)
1008 CFLAGS-ifuncmain1vispic.c
+= $(pic-ccflag
)
1009 CFLAGS-ifuncmain2pic.c
+= $(pic-ccflag
)
1010 CFLAGS-ifuncmain2picstatic.c
+= $(pic-ccflag
)
1011 CFLAGS-ifuncdep2pic.c
+= $(pic-ccflag
)
1012 CFLAGS-ifuncmain4picstatic.c
+= $(pic-ccflag
)
1013 CFLAGS-ifuncmain5pic.c
+= $(pic-ccflag
)
1014 CFLAGS-ifuncmain5picstatic.c
+= $(pic-ccflag
)
1015 CFLAGS-ifuncmain5staticpic.c
+= $(pic-ccflag
)
1016 CFLAGS-ifuncdep5pic.c
+= $(pic-ccflag
)
1017 CFLAGS-ifuncmain7pic.c
+= $(pic-ccflag
)
1018 CFLAGS-ifuncmain7picstatic.c
+= $(pic-ccflag
)
1020 LDFLAGS-ifuncmain3
= -Wl
,-export-dynamic
1022 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1023 CFLAGS-ifuncmain1pie.c
+= $(pie-ccflag
)
1024 CFLAGS-ifuncmain1vispie.c
+= $(pie-ccflag
)
1025 CFLAGS-ifuncmain1staticpie.c
+= $(pie-ccflag
)
1026 CFLAGS-ifuncmain5pie.c
+= $(pie-ccflag
)
1027 CFLAGS-ifuncmain6pie.c
+= $(pie-ccflag
)
1028 CFLAGS-ifuncmain7pie.c
+= $(pie-ccflag
)
1030 $(objpfx
)ifuncmain1pie.out
: $(objpfx
)ifuncmain1pie
1031 $(elf-objpfx
)$(rtld-installed-name
) \
1032 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1035 $(objpfx
)ifuncmain1pie
: $(objpfx
)ifuncmain1pie.o
$(objpfx
)ifuncmod1.so
1038 generated
+= ifuncmain1pie ifuncmain1pie.out
1040 $(objpfx
)ifuncmain1staticpie.out
: $(objpfx
)ifuncmain1staticpie
1041 $(elf-objpfx
)$(rtld-installed-name
) \
1042 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1045 $(objpfx
)ifuncmain1staticpie
: $(objpfx
)ifuncmain1staticpie.o
$(objpfx
)ifuncdep1pic.o
1048 generated
+= ifuncmain1staticpie ifuncmain1staticpie.out
1050 $(objpfx
)ifuncmain1vispie.out
: $(objpfx
)ifuncmain1vispie
1051 $(elf-objpfx
)$(rtld-installed-name
) \
1052 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1055 $(objpfx
)ifuncmain1vispie
: $(objpfx
)ifuncmain1vispie.o
$(objpfx
)ifuncmod1.so
1058 generated
+= ifuncmain1vispie ifuncmain1vispie.out
1060 $(objpfx
)ifuncmain5pie.out
: $(objpfx
)ifuncmain5pie
1061 $(elf-objpfx
)$(rtld-installed-name
) \
1062 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1065 $(objpfx
)ifuncmain5pie
: $(objpfx
)ifuncmain5pie.o
$(objpfx
)ifuncmod5.so
1068 generated
+= ifuncmain5pie ifuncmain5pie.out
1070 $(objpfx
)ifuncmain6pie.out
: $(objpfx
)ifuncmain6pie
1071 $(elf-objpfx
)$(rtld-installed-name
) \
1072 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1075 $(objpfx
)ifuncmain6pie
: $(objpfx
)ifuncmain6pie.o
$(objpfx
)ifuncmod6.so
1078 generated
+= ifuncmain6pie ifuncmain6pie.out
1080 $(objpfx
)ifuncmain7pie.out
: $(objpfx
)ifuncmain7pie
1081 $(elf-objpfx
)$(rtld-installed-name
) \
1082 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1085 $(objpfx
)ifuncmain7pie
: $(objpfx
)ifuncmain7pie.o
1088 generated
+= ifuncmain7pie ifuncmain7pie.out
1091 $(objpfx
)ifuncmain1
: $(addprefix $(objpfx
),ifuncmod1.so
)
1092 $(objpfx
)ifuncmain1pic
: $(addprefix $(objpfx
),ifuncmod1.so
)
1093 $(objpfx
)ifuncmain1staticpic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
1094 $(objpfx
)ifuncmain1static
: $(addprefix $(objpfx
),ifuncdep1.o
)
1095 $(objpfx
)ifuncmain1picstatic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
1096 $(objpfx
)ifuncmain1vis
: $(addprefix $(objpfx
),ifuncmod1.so
)
1097 $(objpfx
)ifuncmain1vispic
: $(addprefix $(objpfx
),ifuncmod1.so
)
1098 $(objpfx
)ifuncmain2
: $(addprefix $(objpfx
),ifuncdep2.o
)
1099 $(objpfx
)ifuncmain2pic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
1100 $(objpfx
)ifuncmain2static
: $(addprefix $(objpfx
),ifuncdep2.o
)
1101 $(objpfx
)ifuncmain2picstatic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
1103 $(objpfx
)ifuncmain3
: $(libdl
)
1104 $(objpfx
)ifuncmain3.out
: $(objpfx
)ifuncmod3.so
1106 $(objpfx
)ifuncmain5
: $(addprefix $(objpfx
),ifuncmod5.so
)
1107 $(objpfx
)ifuncmain5pic
: $(addprefix $(objpfx
),ifuncmod5.so
)
1108 $(objpfx
)ifuncmain5static
: $(addprefix $(objpfx
),ifuncdep5.o
)
1109 $(objpfx
)ifuncmain5staticpic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
1110 $(objpfx
)ifuncmain5picstatic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
1112 $(objpfx
)tst-unique1
: $(libdl
)
1113 $(objpfx
)tst-unique1.out
: $(objpfx
)tst-unique1mod1.so \
1114 $(objpfx
)tst-unique1mod2.so
1116 $(objpfx
)tst-unique2
: $(libdl
) $(objpfx
)tst-unique2mod1.so
1117 $(objpfx
)tst-unique2.out
: $(objpfx
)tst-unique2mod2.so