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 scope \
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 tst-audit4.c \
93 tst-auditmod1.c tst-auditmod3a.c tst-auditmod3b.c \
94 tst-auditmod4a.c tst-auditmod4b.c \
95 tst-audit5.c tst-auditmod5a.c tst-auditmod5b.c \
96 tst-audit6.c tst-auditmod6a.c tst-auditmod6b.c \
98 tst-audit7.c tst-auditmod7a.c tst-auditmod7b.c \
99 order2mod1.c order2mod2.c order2mod3.c order2mod4.c \
100 tst-stackguard1.c tst-stackguard1-static.c \
101 tst-array5.c tst-array5-static.c tst-array5dep.c \
102 tst-array5.exp tst-leaks1.c check-execstack.c \
103 ifuncmain1.c ifuncmain1pic.c ifuncmain1vis.c \
104 ifuncmain1vispic.c ifuncmain1static.c \
105 ifuncmain1staticpic.c ifuncmain1picstatic.c \
106 ifuncdep1.c ifuncdep1pic.c ifuncmod1.c \
107 ifuncmain1pie.c ifuncmain1vispie.c \
108 ifuncmain1staticpie.c \
109 ifuncmain2.c ifuncmain2static.c ifuncdep2.c \
110 ifuncmain2pic.c ifuncmain2picstatic.c ifuncdep2pic.c \
111 ifuncmain3.c ifuncmod3.c \
112 ifuncmain4.c ifuncmain4static.c ifuncmain4picstatic.c \
113 ifuncmain5.c ifuncmain5pic.c ifuncmain5picstatic.c \
114 ifuncmain5pie.c ifuncmain5static.c \
115 ifuncmain5staticpic.c \
116 ifuncdep5.c ifuncdep5pic.c ifuncmod5.c \
117 ifuncmain6pie.c ifuncmod6.c \
118 ifuncmain7.c ifuncmain7pic.c ifuncmain7picstatic.c \
119 ifuncmain7pie.c ifuncmain7static.c \
120 tst-unique1.c tst-unique1mod1.c tst-unique1mod2.c \
121 tst-unique2.c tst-unique2mod1.c tst-unique2mod2.c
123 CFLAGS-dl-runtime.c
= -fexceptions
-fasynchronous-unwind-tables
124 CFLAGS-dl-lookup.c
= -fexceptions
-fasynchronous-unwind-tables
125 CFLAGS-dl-iterate-phdr.c
= $(uses-callbacks
)
127 include ..
/Makeconfig
129 ifeq ($(unwind-find-fde
),yes
)
130 routines
+= unwind-dw2-fde-glibc
131 shared-only-routines
+= unwind-dw2-fde-glibc
134 before-compile
= $(objpfx
)trusted-dirs.h
135 generated
:= trusted-dirs.h trusted-dirs.st for-renamed
/renamed.so
136 generated-dirs
:= for-renamed
138 ifeq ($(versioning
),yes
)
139 ld-map
= $(common-objpfx
)ld.map
142 ifeq (yes
,$(build-shared
))
143 extra-objs
= $(all-rtld-routines
:%=%.os
) soinit.os sofini.os interp.os
144 generated
+= librtld.os dl-allobjs.os
ld.so ldd
145 install-others
= $(inst_slibdir
)/$(rtld-installed-name
)
146 install-bin-script
= ldd
152 install-rootsbin
= sln
154 ifeq (yes
,$(use-ldconfig
))
155 ifeq (yes
,$(build-shared
))
156 others-static
+= ldconfig
158 install-rootsbin
+= ldconfig
160 ldconfig-modules
:= cache readlib xmalloc xstrdup chroot_canon
161 extra-objs
+= $(ldconfig-modules
:=.o
)
163 # To find xmalloc.c and xstrdup.c
164 vpath
%.c ..
/locale
/programs
169 tests
= tst-tls1 tst-tls2 tst-tls9 tst-leaks1
170 ifeq (yes
,$(have-initfini-array
))
171 tests
+= tst-array1 tst-array2 tst-array3 tst-array4 tst-array5
173 ifeq (yes
,$(build-static
))
174 tests-static
= tst-tls1-static tst-tls2-static tst-stackguard1-static
175 ifeq (yesyesyes
,$(build-static
)$(build-shared
)$(elf
))
176 tests-static
+= tst-tls9-static
177 tst-tls9-static-ENV
= \
178 LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
):$(common-objpfx
)dlfcn
180 ifeq (yes
,$(have-initfini-array
))
181 tests-static
+= tst-array1-static tst-array5-static
183 tests
+= $(tests-static
)
185 ifeq (yes
,$(build-shared
))
186 tests
+= loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
187 constload1 order vismain noload
filter unload \
188 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
189 nodlopen nodlopen2 neededtest neededtest2 \
190 neededtest3 neededtest4 unload2 lateglobal initfirst global \
191 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
192 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
193 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
194 tst-tls16 tst-tls17 tst-tls18 tst-tls-dlinfo \
195 tst-align tst-align2
$(tests-execstack-
$(have-z-execstack
)) \
196 tst-dlmodcount tst-dlopenrpath tst-deep1 \
197 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
198 unload3 unload4 unload5 unload6 unload7 tst-global1 order2 \
199 tst-audit1 tst-audit2 \
200 tst-stackguard1 tst-addr1 tst-thrlock \
201 tst-unique1 tst-unique2
203 test-srcs
= tst-pathopt
204 tests-execstack-yes
= tst-execstack tst-execstack-needed tst-execstack-prog
205 ifeq (x86_64
,$(config-machine
))
206 tests
+= tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7
209 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
210 tests
: $(objpfx
)tst-pie1.out
212 tests
: $(objpfx
)tst-leaks1-mem
$(objpfx
)noload-mem
213 tlsmod17a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
214 tlsmod18a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
215 modules-names
= testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
216 testobj1_1 failobj constload2 constload3 unloadmod \
217 dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
218 nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
219 nodel2mod1 nodel2mod2 nodel2mod3 \
220 nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
221 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
222 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
223 neededobj1 neededobj2 neededobj3 neededobj4 \
224 neededobj5 neededobj6 firstobj globalmod1 \
225 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \
226 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \
227 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \
228 reldep7mod1 reldep7mod2 \
229 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \
230 tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
231 tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
232 tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
233 tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
234 $(patsubst %,tst-tlsmod17a
%,$(tlsmod17a-suffixes
)) \
236 $(patsubst %,tst-tlsmod18a
%,$(tlsmod18a-suffixes
)) \
237 circlemod1 circlemod1a circlemod2 circlemod2a \
238 circlemod3 circlemod3a \
239 reldep8mod1 reldep8mod2 reldep8mod3 \
240 reldep9mod1 reldep9mod2 reldep9mod3 \
241 tst-alignmod tst-alignmod2 \
242 $(modules-execstack-
$(have-z-execstack
)) \
243 tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \
244 tst-dlmopen1mod tst-auditmod1 \
245 unload3mod1 unload3mod2 unload3mod3 unload3mod4 \
246 unload4mod1 unload4mod2 unload4mod3 unload4mod4 \
247 unload6mod1 unload6mod2 unload6mod3 \
248 unload7mod1 unload7mod2 \
249 order2mod1 order2mod2 order2mod3 order2mod4 \
250 tst-unique1mod1 tst-unique1mod2 \
251 tst-unique2mod1 tst-unique2mod2
252 ifeq (yes
,$(have-initfini-array
))
253 modules-names
+= tst-array2dep tst-array5dep
255 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
256 modules-names
+= tst-piemod1
258 ifeq (x86_64
,$(config-machine
))
259 modules-names
+= tst-auditmod3a tst-auditmod3b \
260 tst-auditmod4a tst-auditmod4b \
261 tst-auditmod5a tst-auditmod5b \
262 tst-auditmod6a tst-auditmod6b tst-auditmod6c \
263 tst-auditmod7a tst-auditmod7b
265 modules-execstack-yes
= tst-execstack-mod
266 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
267 # We need this variable to be sure the test modules get the right CPPFLAGS.
268 test-extras
+= $(modules-names
)
270 # filtmod1.so has a special rule
271 modules-names-nobuild
:= filtmod1
273 ifeq (yes
,$(multi-arch
))
274 tests-static
+= ifuncmain1static ifuncmain1picstatic \
275 ifuncmain2static ifuncmain2picstatic \
276 ifuncmain4static ifuncmain4picstatic \
277 ifuncmain5static ifuncmain5picstatic \
278 ifuncmain7static ifuncmain7picstatic
280 ifeq (yes
,$(build-shared
))
281 tests
+= ifuncmain1 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \
282 ifuncmain1staticpic \
283 ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \
284 ifuncmain5 ifuncmain5pic ifuncmain5staticpic \
285 ifuncmain7 ifuncmain7pic
286 ifeq (yes
,$(have-fpie
))
287 tests
: $(objpfx
)ifuncmain1pie.out
$(objpfx
)ifuncmain1vispie.out \
288 $(objpfx
)ifuncmain1staticpie.out
$(objpfx
)ifuncmain5pie.out \
289 $(objpfx
)ifuncmain6pie.out
$(objpfx
)ifuncmain7pie.out
291 modules-names
+= ifuncmod1 ifuncmod3 ifuncmod5 ifuncmod6
298 check-abi
: check-abi-ld
299 update-abi
: update-abi-ld
301 ifeq (yes
,$(build-shared
))
302 # Make sure these things are built in the `make lib' pass so they can be used
303 # to run programs during the `make others' pass.
304 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
305 $(addprefix $(objpfx
),$(extra-objs
))
308 # Command to link into a larger single relocatable object.
309 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
311 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
312 $(reloc-link
) -o
$@
$^
314 # Link together the dynamic linker into a single relocatable object.
315 # First we do a link against libc_pic.a just to get a link map,
316 # and discard the object produced by that link. From the link map
317 # we can glean all the libc modules that need to go into the dynamic
318 # linker. Then we do a recursive make that goes into all the subdirs
319 # those modules come from and builds special rtld-foo.os versions that
320 # are compiled with special flags, and puts these modules into rtld-libc.a
321 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
323 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
325 $(reloc-link
) -o
$@.o
'-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
329 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
331 sed
-n
's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
333 while read lib file
; do \
336 LC_ALL
=C fgrep
-l
/$$file \
337 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
339 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
342 echo rtld-
$${lib
%%/*} += $$file ;; \
343 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
346 echo rtld-subdirs
= `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
347 | LC_ALL=C sort -u` >> $@T
350 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
351 $(MAKE
) -f
$< -f rtld-Rules
353 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
354 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)' \
357 generated
+= librtld.map librtld.mk rtld-libc.a librtld.os.map
359 z-now-yes
= -Wl
,-z
,now
361 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
363 $(LINK.o
) -nostdlib
-nostartfiles
-shared
$(z-now-
$(bind-now
)) \
364 $(LDFLAGS-rtld
) -Wl
,-z
,defs
-Wl
,--verbose
2>&1 | \
366 sed
-e
'/^=========/,/^=========/!d;/^=========/d' \
367 -e
's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
369 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@ \
370 $(LDFLAGS-rtld
) -Wl
,-z
,defs
$(z-now-
$(bind-now
)) \
371 $(filter-out $(map-file
),$^
) $(load-map-file
) \
372 -Wl
,-soname
=$(rtld-installed-name
) -T
$@.lds
375 |
$(AWK
) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
377 # interp.c exists just to get this string into the libraries.
378 CFLAGS-interp.c
= -D
'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \
380 $(objpfx
)interp.os
: $(common-objpfx
)config.make
382 ifneq (ld.so
,$(rtld-installed-name
))
383 # Make sure ld.so.1 exists in the build directory so we can link
385 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
388 generated
+= $(rtld-installed-name
)
391 # Build a file mentioning all trustworthy directories to look for shared
392 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
393 # add directories to the list by defining $(user-defined-trusted-dirs)
394 # before starting make.
395 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
396 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
397 $(make-target-directory
)
398 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
399 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
400 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
401 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
403 CPPFLAGS-dl-load.c
= -I
$(objpfx
).
-I
$(csu-objpfx
).
405 ifeq (yes
,$(build-shared
))
406 $(inst_slibdir
)/$(rtld-version-installed-name
): $(objpfx
)ld.so
$(+force)
407 $(make-target-directory
)
408 $(do-install-program
)
410 $(inst_slibdir
)/$(rtld-installed-name
): \
411 $(inst_slibdir
)/$(rtld-version-installed-name
) \
412 $(inst_slibdir
)/libc-
$(version
).so
415 # Special target called by parent to install just the dynamic linker.
417 ldso_install
: $(inst_slibdir
)/$(rtld-installed-name
)
421 common-ldd-rewrite
= -e
's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
422 -e
's%@VERSION@%$(version)%g'
423 sh-ldd-rewrite
= $(common-ldd-rewrite
) -e
's%@BASH@%/bin/sh%g;s/\$$"/"/g'
424 bash-ldd-rewrite
= $(common-ldd-rewrite
) -e
's%@BASH@%$(BASH)%g' \
425 -e
's%@TEXTDOMAINDIR@%$(msgcatdir)%g'
427 ifneq ($(have-bash2
),yes
)
433 ifeq ($(ldd-rewrite-script
),no
)
435 LC_ALL
=C sed
$($(ldd-shell
)-ldd-rewrite
) < $< > $@.new
439 LC_ALL
=C sed
$($(ldd-shell
)-ldd-rewrite
) < $< | LC_ALL
=C sed
-f
$(ldd-rewrite-script
) > $@.new
443 $(objpfx
)ldd
: ldd.bash.in
$(common-objpfx
)soversions.mk \
444 $(common-objpfx
)config.make
449 $(objpfx
)sprof
: $(libdl
)
451 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
452 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
453 CFLAGS-ldconfig.c
= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' \
454 -D
'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig
=1
455 CFLAGS-dl-cache.c
= $(SYSCONF-FLAGS
)
456 CFLAGS-cache.c
= $(SYSCONF-FLAGS
)
458 CPPFLAGS-.os
+= $(if
$(filter $(@F
),$(patsubst %,%.os
,$(all-rtld-routines
))),-DNOT_IN_libc
=1 -DIS_IN_rtld
=1)
460 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
461 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
463 ifeq (yes
,$(build-shared
))
464 ifeq ($(cross-compiling
),no
)
465 tests
: $(objpfx
)tst-pathopt.out
469 $(objpfx
)testobj1.so
: $(libdl
)
470 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
$(libdl
)
471 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
$(libdl
)
472 $(objpfx
)testobj3.so
: $(libdl
)
473 $(objpfx
)testobj4.so
: $(libdl
)
474 $(objpfx
)testobj5.so
: $(libdl
)
475 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
$(libdl
)
476 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
477 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
478 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
479 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
480 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
481 $(objpfx
)nextmod1.so
: $(libdl
)
482 $(objpfx
)neededobj1.so
: $(libdl
)
483 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
$(libdl
)
484 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
$(libdl
)
485 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
486 $(objpfx
)neededobj3.so
$(libdl
)
487 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
488 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
489 $(objpfx
)ltglobmod2.so
: $(libdl
)
490 $(objpfx
)firstobj.so
: $(shared-thread-library
)
491 $(objpfx
)globalmod1.so
: $(libdl
)
492 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
493 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
494 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
495 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
496 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
497 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
498 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
499 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
500 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
501 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
502 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
503 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
504 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
505 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
506 $(objpfx
)tst-tlsmod13a.so
: $(objpfx
)tst-tlsmod13.so
507 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
508 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
509 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
510 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
511 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
512 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
513 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
514 $(objpfx
)unload3mod1.so
: $(objpfx
)unload3mod3.so
515 $(objpfx
)unload3mod2.so
: $(objpfx
)unload3mod3.so
516 $(objpfx
)unload3mod3.so
: $(objpfx
)unload3mod4.so
517 $(objpfx
)unload4mod1.so
: $(objpfx
)unload4mod2.so
$(objpfx
)unload4mod3.so
518 $(objpfx
)unload4mod2.so
: $(objpfx
)unload4mod4.so
$(objpfx
)unload4mod3.so
519 $(objpfx
)unload6mod1.so
: $(libdl
)
520 $(objpfx
)unload6mod2.so
: $(libdl
)
521 $(objpfx
)unload6mod3.so
: $(libdl
)
522 $(objpfx
)unload7mod1.so
: $(libdl
)
523 $(objpfx
)unload7mod2.so
: $(objpfx
)unload7mod1.so
525 LDFLAGS-tst-tlsmod5.so
= -nostdlib
526 LDFLAGS-tst-tlsmod6.so
= -nostdlib
528 testobj1.so-no-z-defs
= yes
529 testobj3.so-no-z-defs
= yes
530 testobj4.so-no-z-defs
= yes
531 testobj5.so-no-z-defs
= yes
532 testobj6.so-no-z-defs
= yes
533 failobj.so-no-z-defs
= yes
534 constload2.so-no-z-defs
= yes
535 constload3.so-no-z-defs
= yes
536 nodelmod1.so-no-z-defs
= yes
537 nodelmod2.so-no-z-defs
= yes
538 nodelmod4.so-no-z-defs
= yes
539 nodel2mod2.so-no-z-defs
= yes
540 reldepmod2.so-no-z-defs
= yes
541 reldepmod3.so-no-z-defs
= yes
542 reldepmod4.so-no-z-defs
= yes
543 reldep4mod4.so-no-z-defs
= yes
544 reldep4mod2.so-no-z-defs
= yes
545 ltglobmod2.so-no-z-defs
= yes
546 dblloadmod3.so-no-z-defs
= yes
547 tst-tlsmod1.so-no-z-defs
= yes
548 tst-tlsmod2.so-no-z-defs
= yes
549 tst-tlsmod3.so-no-z-defs
= yes
550 tst-tlsmod4.so-no-z-defs
= yes
551 tst-tlsmod7.so-no-z-defs
= yes
552 tst-tlsmod8.so-no-z-defs
= yes
553 tst-tlsmod9.so-no-z-defs
= yes
554 tst-tlsmod10.so-no-z-defs
= yes
555 tst-tlsmod12.so-no-z-defs
= yes
556 tst-tlsmod14a.so-no-z-defs
= yes
557 tst-tlsmod14b.so-no-z-defs
= yes
558 tst-tlsmod15a.so-no-z-defs
= yes
559 tst-tlsmod16b.so-no-z-defs
= yes
560 circlemod2.so-no-z-defs
= yes
561 circlemod3.so-no-z-defs
= yes
562 circlemod3a.so-no-z-defs
= yes
563 reldep8mod2.so-no-z-defs
= yes
564 reldep9mod1.so-no-z-defs
= yes
565 unload3mod4.so-no-z-defs
= yes
566 unload4mod1.so-no-z-defs
= yes
567 ifuncmod1.so-no-z-defs
= yes
568 ifuncmod5.so-no-z-defs
= yes
569 ifuncmod6.so-no-z-defs
= yes
571 ifeq ($(build-shared
),yes
)
572 # Build all the modules even when not actually running test programs.
573 tests
: $(test-modules
)
576 $(objpfx
)loadtest
: $(libdl
)
577 LDFLAGS-loadtest
= -rdynamic
579 $(objpfx
)loadtest.out
: $(test-modules
)
581 $(objpfx
)neededtest
: $(libdl
)
582 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
583 $(objpfx
)neededobj3.so
585 $(objpfx
)neededtest2
: $(libdl
)
586 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
587 $(objpfx
)neededobj3.so
589 $(objpfx
)neededtest3
: $(libdl
)
590 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
591 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
593 neededtest4-ENV
= LC_ALL
=C LANGUAGE
=C
594 $(objpfx
)neededtest4
: $(libdl
) $(objpfx
)neededobj1.so
595 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
597 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
$(libdl
)
598 LDFLAGS-restest1
= -rdynamic
600 $(objpfx
)restest2
: $(libdl
)
601 LDFLAGS-restest2
= -rdynamic
603 $(objpfx
)restest1.out
: $(test-modules
)
605 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
606 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
607 LDFLAGS-preloadtest
= -rdynamic
608 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
610 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
612 $(objpfx
)loadfail
: $(libdl
)
613 LDFLAGS-loadfail
= -rdynamic
615 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
617 $(objpfx
)multiload
: $(libdl
)
618 LDFLAGS-multiload
= -rdynamic
619 CFLAGS-multiload.c
= -DOBJDIR
=\"$(elf-objpfx
)\"
621 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
623 $(objpfx
)origtest
: $(libdl
)
624 LDFLAGS-origtest
= -rdynamic
625 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
627 ifeq ($(have-thread-library
),yes
)
628 $(objpfx
)resolvfail
: $(libdl
) $(shared-thread-library
)
630 $(objpfx
)resolvfail
: $(libdl
)
633 $(objpfx
)constload1
: $(libdl
)
634 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
636 $(objpfx
)circleload1
: $(libdl
)
637 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
638 $(objpfx
)circlemod1a.so
640 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
641 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
642 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
643 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
645 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
647 $(objpfx
)order.out
: $(objpfx
)order
648 $(elf-objpfx
)$(rtld-installed-name
) \
649 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
651 (echo
"0123456789" | cmp
$@
-) > /dev
/null
653 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
654 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
655 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
657 $(objpfx
)noload
: $(objpfx
)testobj1.so
658 LDFLAGS-noload
= -rdynamic
659 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
661 $(objpfx
)noload-mem
: $(objpfx
)noload.out
662 $(common-objpfx
)malloc
/mtrace
$(objpfx
)noload.mtrace
> $@
663 noload-ENV
= MALLOC_TRACE
=$(objpfx
)noload.mtrace
665 LDFLAGS-nodelete
= -rdynamic
666 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
667 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
668 $(objpfx
)nodelete
: $(libdl
)
669 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
670 $(objpfx
)nodelmod3.so
672 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
673 $(objpfx
)nodlopen
: $(libdl
)
674 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
676 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
677 $(objpfx
)nodlopen2
: $(libdl
)
678 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
680 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
681 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
682 -L
$(subst :, -L
,$(rpath-link
)) \
683 -Wl
,-rpath-link
=$(rpath-link
) \
684 $< -Wl
,-F
,$(objpfx
)filtmod2.so
685 $(objpfx
)filter: $(objpfx
)filtmod1.so
687 $(objpfx
)unload
: $(libdl
)
688 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
690 $(objpfx
)reldep
: $(libdl
)
691 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
693 $(objpfx
)reldep2
: $(libdl
)
694 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
696 $(objpfx
)reldep3
: $(libdl
)
697 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
699 $(objpfx
)reldep4
: $(libdl
)
700 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
702 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
$(libdl
)
704 $(objpfx
)unload2
: $(libdl
)
705 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
707 $(objpfx
)lateglobal
: $(libdl
)
708 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
710 $(objpfx
)tst-pathopt
: $(libdl
)
711 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
712 $(objpfx
)pathoptobj.so
713 $(SHELL
) -e
$< $(common-objpfx
)
715 $(objpfx
)initfirst
: $(libdl
)
716 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
718 $(objpfx
)global
: $(objpfx
)globalmod1.so
719 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
721 $(objpfx
)dblload
: $(libdl
)
722 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
724 $(objpfx
)dblunload
: $(libdl
)
725 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
727 $(objpfx
)reldep5
: $(libdl
)
728 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod6.so
730 $(objpfx
)reldep6
: $(libdl
)
731 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
733 $(objpfx
)reldep7
: $(libdl
)
734 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
736 $(objpfx
)reldep8
: $(libdl
)
737 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
739 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
740 $(objpfx
)nodelete2
: $(libdl
)
741 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
743 $(objpfx
)reldep9
: $(libdl
)
744 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
746 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
748 $(objpfx
)tst-tls4
: $(libdl
)
749 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
751 $(objpfx
)tst-tls5
: $(libdl
)
752 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
754 $(objpfx
)tst-tls6
: $(libdl
)
755 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
757 $(objpfx
)tst-tls7
: $(libdl
)
758 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
760 $(objpfx
)tst-tls8
: $(libdl
)
761 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
763 $(objpfx
)tst-tls9
: $(libdl
)
764 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
766 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
$(objpfx
)tst-tlsmod7.so
768 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
$(objpfx
)tst-tlsmod9.so
770 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
$(objpfx
)tst-tlsmod11.so
772 $(objpfx
)tst-tls13
: $(libdl
)
773 $(objpfx
)tst-tls13.out
: $(objpfx
)tst-tlsmod13a.so
775 $(objpfx
)tst-tls14
: $(objpfx
)tst-tlsmod14a.so
$(libdl
)
776 $(objpfx
)tst-tls14.out
: $(objpfx
)tst-tlsmod14b.so
778 $(objpfx
)tst-tls15
: $(libdl
)
779 $(objpfx
)tst-tls15.out
: $(objpfx
)tst-tlsmod15a.so
$(objpfx
)tst-tlsmod15b.so
781 $(objpfx
)tst-tls-dlinfo
: $(libdl
)
782 $(objpfx
)tst-tls-dlinfo.out
: $(objpfx
)tst-tlsmod2.so
786 $(objpfx
)tst-tls16
: $(libdl
)
787 $(objpfx
)tst-tls16.out
: $(objpfx
)tst-tlsmod16a.so
$(objpfx
)tst-tlsmod16b.so
789 $(objpfx
)tst-tls17
: $(libdl
)
790 $(objpfx
)tst-tls17.out
: $(objpfx
)tst-tlsmod17b.so
791 $(patsubst %,$(objpfx
)tst-tlsmod17a
%.os
,$(tlsmod17a-suffixes
)): $(objpfx
)tst-tlsmod17a
%.os
: tst-tlsmod17a.c
792 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -c
-o
$@
-DN
=$* -DNOT_IN_libc
=1 $<
793 $(patsubst %,$(objpfx
)tst-tlsmod17a
%.so
,$(tlsmod17a-suffixes
)): $(objpfx
)tst-tlsmod17a
%.so
: $(objpfx
)ld.so
794 $(objpfx
)tst-tlsmod17b.so
: $(patsubst %,$(objpfx
)tst-tlsmod17a
%.so
,$(tlsmod17a-suffixes
))
796 $(objpfx
)tst-tls18
: $(libdl
)
797 $(objpfx
)tst-tls18.out
: $(patsubst %,$(objpfx
)tst-tlsmod18a
%.so
,$(tlsmod18a-suffixes
))
798 $(patsubst %,$(objpfx
)tst-tlsmod18a
%.os
,$(tlsmod18a-suffixes
)): $(objpfx
)tst-tlsmod18a
%.os
: tst-tlsmod18a.c
799 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -c
-o
$@
-DN
=$* -DNOT_IN_libc
=1 $<
800 $(patsubst %,$(objpfx
)tst-tlsmod18a
%.so
,$(tlsmod18a-suffixes
)): $(objpfx
)tst-tlsmod18a
%.so
: $(objpfx
)ld.so
802 CFLAGS-tst-align.c
= $(stack-align-test-flags
)
803 CFLAGS-tst-align2.c
= $(stack-align-test-flags
)
804 CFLAGS-tst-alignmod.c
= $(stack-align-test-flags
)
805 CFLAGS-tst-alignmod2.c
= $(stack-align-test-flags
)
806 $(objpfx
)tst-align
: $(libdl
)
807 $(objpfx
)tst-align.out
: $(objpfx
)tst-alignmod.so
808 $(objpfx
)tst-align2
: $(objpfx
)tst-alignmod2.so
810 $(objpfx
)unload3
: $(libdl
)
811 $(objpfx
)unload3.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
812 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
814 $(objpfx
)unload4
: $(libdl
)
815 $(objpfx
)unload4.out
: $(objpfx
)unload4mod1.so
$(objpfx
)unload4mod3.so
817 $(objpfx
)unload5
: $(libdl
)
818 $(objpfx
)unload5.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
819 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
821 $(objpfx
)unload6
: $(libdl
)
822 $(objpfx
)unload6.out
: $(objpfx
)unload6mod1.so
$(objpfx
)unload6mod2.so \
823 $(objpfx
)unload6mod3.so
825 $(objpfx
)unload7
: $(libdl
)
826 $(objpfx
)unload7.out
: $(objpfx
)unload7mod1.so
$(objpfx
)unload7mod2.so
827 unload7-ENV
= MALLOC_PERTURB_
=85
830 $(objpfx
)tst-tls9-static
: $(common-objpfx
)dlfcn
/libdl.a
831 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
834 ifeq ($(have-z-execstack
),yes
)
835 $(objpfx
)tst-execstack
: $(libdl
)
836 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
837 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
838 LDFLAGS-tst-execstack-mod
= -Wl
,-z
,execstack
840 $(objpfx
)tst-execstack-needed
: $(objpfx
)tst-execstack-mod.so
841 LDFLAGS-tst-execstack-needed
= -Wl
,-z
,noexecstack
843 LDFLAGS-tst-execstack-prog
= -Wl
,-z
,execstack
846 $(objpfx
)tst-array1.out
: $(objpfx
)tst-array1
847 $(elf-objpfx
)$(rtld-installed-name
) \
848 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
849 $(objpfx
)tst-array1
> $@
850 cmp
$@ tst-array1.exp
> /dev
/null
852 $(objpfx
)tst-array1-static.out
: $(objpfx
)tst-array1-static
853 $(objpfx
)tst-array1-static
> $@
854 cmp
$@ tst-array1.exp
> /dev
/null
856 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
857 $(objpfx
)tst-array2.out
: $(objpfx
)tst-array2
858 $(elf-objpfx
)$(rtld-installed-name
) \
859 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
860 $(objpfx
)tst-array2
> $@
861 cmp
$@ tst-array2.exp
> /dev
/null
863 $(objpfx
)tst-array3.out
: $(objpfx
)tst-array3
864 $(elf-objpfx
)$(rtld-installed-name
) \
865 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
866 $(objpfx
)tst-array3
> $@
867 cmp
$@ tst-array1.exp
> /dev
/null
869 $(objpfx
)tst-array4
: $(libdl
)
870 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array4
$(objpfx
)tst-array2dep.so
871 $(elf-objpfx
)$(rtld-installed-name
) \
872 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
874 cmp
$@ tst-array4.exp
> /dev
/null
876 $(objpfx
)tst-array5
: $(objpfx
)tst-array5dep.so
877 $(objpfx
)tst-array5.out
: $(objpfx
)tst-array5
878 $(elf-objpfx
)$(rtld-installed-name
) \
879 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
880 $(objpfx
)tst-array5
> $@
881 cmp
$@ tst-array5.exp
> /dev
/null
883 $(objpfx
)tst-array5-static.out
: $(objpfx
)tst-array5-static
884 $(objpfx
)tst-array5-static
> $@
885 cmp
$@ tst-array5-static.exp
> /dev
/null
887 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
888 CFLAGS-tst-pie1.c
+= $(pie-ccflag
)
890 $(objpfx
)tst-pie1.out
: $(objpfx
)tst-pie1
891 $(elf-objpfx
)$(rtld-installed-name
) \
892 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
895 $(objpfx
)tst-pie1
: $(objpfx
)tst-pie1.o
$(objpfx
)tst-piemod1.so
898 generated
+= tst-pie1 tst-pie1.out tst-pie1.o
901 check-textrel-CFLAGS
= -O
-Wall
-D_XOPEN_SOURCE
=600 -D_BSD_SOURCE
902 $(objpfx
)check-textrel
: check-textrel.c
905 check-execstack-CFLAGS
= -O
-Wall
-D_XOPEN_SOURCE
=600 -D_BSD_SOURCE
-std
=gnu99
906 $(objpfx
)check-execstack
: check-execstack.c
909 check-localplt-CFLAGS
= -O
-Wall
-D_GNU_SOURCE
-std
=gnu99
910 $(objpfx
)check-localplt
: check-localplt.c
913 ifeq (yes
,$(build-shared
))
914 tests
: $(objpfx
)check-textrel.out
$(objpfx
)check-execstack.out
916 $(objpfx
)check-textrel.out
: $(objpfx
)check-textrel
917 $(dir $<)$(notdir $<) $(common-objpfx
)libc.so \
918 $(sort $(wildcard $(common-objpfx
)*/lib
*.so \
919 $(common-objpfx
)iconvdata
/*.so
)) > $@
920 generated
+= check-textrel check-textrel.out
922 $(objpfx
)check-execstack.out
: $(objpfx
)check-execstack
923 $(dir $<)$(notdir $<) $(common-objpfx
)libc.so \
924 $(sort $(wildcard $(common-objpfx
)*/lib
*.so \
925 $(common-objpfx
)iconvdata
/*.so
)) > $@
926 generated
+= check-execstack check-execstack.out
928 $(objpfx
)tst-dlmodcount
: $(libdl
)
929 $(objpfx
)tst-dlmodcount.out
: $(test-modules
)
931 check-data
:= $(firstword $(wildcard \
932 $(foreach D
,$(add-ons
) scripts
,\
933 $(patsubst %,$(..
)$D/data
/localplt-
%.data
,\
935 $(addsuffix -$(config-os
),\
940 tests
: $(objpfx
)check-localplt.out
942 ifeq ($(have-thread-library
),yes
)
943 thread-dso
:= $(filter-out %_nonshared.a
, $(shared-thread-library
))
946 $(objpfx
)check-localplt.out
: $(objpfx
)check-localplt \
947 $(common-objpfx
)libc.so \
948 $(common-objpfx
)math
/libm.so
$(thread-dso
) \
949 $(common-objpfx
)rt
/librt.so \
950 $(common-objpfx
)dlfcn
/libdl.so \
951 $(common-objpfx
)resolv
/libresolv.so \
952 $(common-objpfx
)crypt
/libcrypt.so \
954 $(dir $<)$(notdir $<) $(filter-out $< $(check-data
),$^
) | \
956 diff
-u
$(check-data
) - > $@
959 $(objpfx
)tst-dlopenrpathmod.so
: $(libdl
)
960 $(objpfx
)tst-dlopenrpath
: $(objpfx
)tst-dlopenrpathmod.so
$(libdl
)
961 CFLAGS-tst-dlopenrpath.c
+= -DPFX
=\"$(objpfx
)\"
962 LDFLAGS-tst-dlopenrpathmod.so
+= -Wl
,-rpath
,\
$$ORIGIN/test-subdir
963 $(objpfx
)tst-dlopenrpath.out
: $(objpfx
)firstobj.so
965 $(objpfx
)tst-deep1mod2.so
: $(objpfx
)tst-deep1mod3.so
966 $(objpfx
)tst-deep1
: $(libdl
) $(objpfx
)tst-deep1mod1.so
967 $(objpfx
)tst-deep1.out
: $(objpfx
)tst-deep1mod2.so
968 LDFLAGS-tst-deep1
+= -rdynamic
969 tst-deep1mod3.so-no-z-defs
= yes
971 $(objpfx
)tst-dlmopen1mod.so
: $(libdl
)
972 $(objpfx
)tst-dlmopen1
: $(libdl
)
973 $(objpfx
)tst-dlmopen1.out
: $(objpfx
)tst-dlmopen1mod.so
975 $(objpfx
)tst-dlmopen2
: $(libdl
)
976 $(objpfx
)tst-dlmopen2.out
: $(objpfx
)tst-dlmopen1mod.so
978 $(objpfx
)tst-dlmopen3
: $(libdl
)
979 $(objpfx
)tst-dlmopen3.out
: $(objpfx
)tst-dlmopen1mod.so
981 $(objpfx
)tst-audit1.out
: $(objpfx
)tst-auditmod1.so
982 tst-audit1-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
984 $(objpfx
)tst-audit2.out
: $(objpfx
)tst-auditmod1.so
985 tst-audit2-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
987 $(objpfx
)tst-audit3
: $(objpfx
)tst-auditmod3a.so
988 $(objpfx
)tst-audit3.out
: $(objpfx
)tst-auditmod3b.so
989 tst-audit3-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod3b.so
991 $(objpfx
)tst-audit4
: $(objpfx
)tst-auditmod4a.so
992 $(objpfx
)tst-audit4.out
: $(objpfx
)tst-auditmod4b.so
993 tst-audit4-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod4b.so
995 $(objpfx
)tst-audit5
: $(objpfx
)tst-auditmod5a.so
996 $(objpfx
)tst-audit5.out
: $(objpfx
)tst-auditmod5b.so
997 tst-audit5-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod5b.so
999 $(objpfx
)tst-audit6
: $(objpfx
)tst-auditmod6a.so
1000 $(objpfx
)tst-audit6.out
: $(objpfx
)tst-auditmod6b.so \
1001 $(objpfx
)tst-auditmod6c.so
1002 tst-audit6-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod6b.so
:$(objpfx
)tst-auditmod6c.so
1004 $(objpfx
)tst-audit7
: $(objpfx
)tst-auditmod7a.so
1005 $(objpfx
)tst-audit7.out
: $(objpfx
)tst-auditmod7b.so
1006 tst-audit7-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod7b.so
1008 $(objpfx
)tst-global1
: $(libdl
)
1009 $(objpfx
)tst-global1.out
: $(objpfx
)testobj6.so
$(objpfx
)testobj2.so
1011 $(objpfx
)order2
: $(libdl
)
1012 $(objpfx
)order2.out
: $(objpfx
)order2
$(objpfx
)order2mod1.so \
1013 $(objpfx
)order2mod2.so
1014 $(elf-objpfx
)$(rtld-installed-name
) \
1015 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1016 $(objpfx
)order2
> $@
1017 (echo
"12345" | cmp
$@
-) > /dev
/null
1018 $(objpfx
)order2mod1.so
: $(objpfx
)order2mod4.so
1019 $(objpfx
)order2mod4.so
: $(objpfx
)order2mod3.so
1020 $(objpfx
)order2mod2.so
: $(objpfx
)order2mod3.so
1021 order2mod2.so-no-z-defs
= yes
1023 tst-stackguard1-ARGS
= --command
"$(built-program-cmd) --child"
1024 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
1026 $(objpfx
)tst-leaks1
: $(libdl
)
1027 $(objpfx
)tst-leaks1-mem
: $(objpfx
)tst-leaks1.out
1028 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1.mtrace
> $@
1030 tst-leaks1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1.mtrace
1032 $(objpfx
)tst-addr1
: $(libdl
)
1034 $(objpfx
)tst-thrlock
: $(libdl
) $(shared-thread-library
)
1036 CFLAGS-ifuncmain1pic.c
+= $(pic-ccflag
)
1037 CFLAGS-ifuncmain1picstatic.c
+= $(pic-ccflag
)
1038 CFLAGS-ifuncmain1staticpic.c
+= $(pic-ccflag
)
1039 CFLAGS-ifuncdep1pic.c
+= $(pic-ccflag
)
1040 CFLAGS-ifuncmain1vispic.c
+= $(pic-ccflag
)
1041 CFLAGS-ifuncmain2pic.c
+= $(pic-ccflag
)
1042 CFLAGS-ifuncmain2picstatic.c
+= $(pic-ccflag
)
1043 CFLAGS-ifuncdep2pic.c
+= $(pic-ccflag
)
1044 CFLAGS-ifuncmain4picstatic.c
+= $(pic-ccflag
)
1045 CFLAGS-ifuncmain5pic.c
+= $(pic-ccflag
)
1046 CFLAGS-ifuncmain5picstatic.c
+= $(pic-ccflag
)
1047 CFLAGS-ifuncmain5staticpic.c
+= $(pic-ccflag
)
1048 CFLAGS-ifuncdep5pic.c
+= $(pic-ccflag
)
1049 CFLAGS-ifuncmain7pic.c
+= $(pic-ccflag
)
1050 CFLAGS-ifuncmain7picstatic.c
+= $(pic-ccflag
)
1052 LDFLAGS-ifuncmain3
= -Wl
,-export-dynamic
1054 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
1055 CFLAGS-ifuncmain1pie.c
+= $(pie-ccflag
)
1056 CFLAGS-ifuncmain1vispie.c
+= $(pie-ccflag
)
1057 CFLAGS-ifuncmain1staticpie.c
+= $(pie-ccflag
)
1058 CFLAGS-ifuncmain5pie.c
+= $(pie-ccflag
)
1059 CFLAGS-ifuncmain6pie.c
+= $(pie-ccflag
)
1060 CFLAGS-ifuncmain7pie.c
+= $(pie-ccflag
)
1062 $(objpfx
)ifuncmain1pie.out
: $(objpfx
)ifuncmain1pie
1063 $(elf-objpfx
)$(rtld-installed-name
) \
1064 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1067 $(objpfx
)ifuncmain1pie
: $(objpfx
)ifuncmain1pie.o
$(objpfx
)ifuncmod1.so
1070 generated
+= ifuncmain1pie ifuncmain1pie.out
1072 $(objpfx
)ifuncmain1staticpie.out
: $(objpfx
)ifuncmain1staticpie
1073 $(elf-objpfx
)$(rtld-installed-name
) \
1074 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1077 $(objpfx
)ifuncmain1staticpie
: $(objpfx
)ifuncmain1staticpie.o
$(objpfx
)ifuncdep1pic.o
1080 generated
+= ifuncmain1staticpie ifuncmain1staticpie.out
1082 $(objpfx
)ifuncmain1vispie.out
: $(objpfx
)ifuncmain1vispie
1083 $(elf-objpfx
)$(rtld-installed-name
) \
1084 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1087 $(objpfx
)ifuncmain1vispie
: $(objpfx
)ifuncmain1vispie.o
$(objpfx
)ifuncmod1.so
1090 generated
+= ifuncmain1vispie ifuncmain1vispie.out
1092 $(objpfx
)ifuncmain5pie.out
: $(objpfx
)ifuncmain5pie
1093 $(elf-objpfx
)$(rtld-installed-name
) \
1094 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1097 $(objpfx
)ifuncmain5pie
: $(objpfx
)ifuncmain5pie.o
$(objpfx
)ifuncmod5.so
1100 generated
+= ifuncmain5pie ifuncmain5pie.out
1102 $(objpfx
)ifuncmain6pie.out
: $(objpfx
)ifuncmain6pie
1103 $(elf-objpfx
)$(rtld-installed-name
) \
1104 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1107 $(objpfx
)ifuncmain6pie
: $(objpfx
)ifuncmain6pie.o
$(objpfx
)ifuncmod6.so
1110 generated
+= ifuncmain6pie ifuncmain6pie.out
1112 $(objpfx
)ifuncmain7pie.out
: $(objpfx
)ifuncmain7pie
1113 $(elf-objpfx
)$(rtld-installed-name
) \
1114 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
1117 $(objpfx
)ifuncmain7pie
: $(objpfx
)ifuncmain7pie.o
1120 generated
+= ifuncmain7pie ifuncmain7pie.out
1123 $(objpfx
)ifuncmain1
: $(addprefix $(objpfx
),ifuncmod1.so
)
1124 $(objpfx
)ifuncmain1pic
: $(addprefix $(objpfx
),ifuncmod1.so
)
1125 $(objpfx
)ifuncmain1staticpic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
1126 $(objpfx
)ifuncmain1static
: $(addprefix $(objpfx
),ifuncdep1.o
)
1127 $(objpfx
)ifuncmain1picstatic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
1128 $(objpfx
)ifuncmain1vis
: $(addprefix $(objpfx
),ifuncmod1.so
)
1129 $(objpfx
)ifuncmain1vispic
: $(addprefix $(objpfx
),ifuncmod1.so
)
1130 $(objpfx
)ifuncmain2
: $(addprefix $(objpfx
),ifuncdep2.o
)
1131 $(objpfx
)ifuncmain2pic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
1132 $(objpfx
)ifuncmain2static
: $(addprefix $(objpfx
),ifuncdep2.o
)
1133 $(objpfx
)ifuncmain2picstatic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
1135 $(objpfx
)ifuncmain3
: $(libdl
)
1136 $(objpfx
)ifuncmain3.out
: $(objpfx
)ifuncmod3.so
1138 $(objpfx
)ifuncmain5
: $(addprefix $(objpfx
),ifuncmod5.so
)
1139 $(objpfx
)ifuncmain5pic
: $(addprefix $(objpfx
),ifuncmod5.so
)
1140 $(objpfx
)ifuncmain5static
: $(addprefix $(objpfx
),ifuncdep5.o
)
1141 $(objpfx
)ifuncmain5staticpic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
1142 $(objpfx
)ifuncmain5picstatic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
1144 $(objpfx
)tst-unique1
: $(libdl
)
1145 $(objpfx
)tst-unique1.out
: $(objpfx
)tst-unique1mod1.so \
1146 $(objpfx
)tst-unique1mod2.so
1148 $(objpfx
)tst-unique2
: $(libdl
) $(objpfx
)tst-unique2mod1.so
1149 $(objpfx
)tst-unique2.out
: $(objpfx
)tst-unique2mod2.so
1151 ifeq (yes
,$(config-cflags-avx
))
1152 CFLAGS-tst-audit4.c
+= -mavx
1153 CFLAGS-tst-auditmod4a.c
+= -mavx
1154 CFLAGS-tst-auditmod4b.c
+= -mavx
1155 CFLAGS-tst-auditmod6b.c
+= -mavx
1156 CFLAGS-tst-auditmod6c.c
+= -mavx
1157 CFLAGS-tst-auditmod7b.c
+= -mavx