1 # Copyright (C) 1995-2015 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <http://www.gnu.org/licenses/>.
18 # Makefile for elf subdirectory of GNU C Library.
24 headers
= elf.h bits
/elfclass.h link.h bits
/link.h
25 routines
= $(all-dl-routines
) dl-support dl-iteratephdr \
26 dl-addr enbl-secure dl-profstub \
27 dl-origin dl-libc dl-sym dl-tsd dl-sysdep
29 # The core dynamic linking functions are in libc for the static and
31 dl-routines
= $(addprefix dl-
,load lookup object reloc deps hwcaps \
32 runtime error init fini debug misc \
33 version profile conflict tls
origin scope \
34 execstack caller open close trampoline
)
35 ifeq (yes
,$(use-ldconfig
))
36 dl-routines
+= dl-cache
38 all-dl-routines
= $(dl-routines
) $(sysdep-dl-routines
)
39 # But they are absent from the shared libc, because that code is in ld.so.
40 elide-routines.os
= $(all-dl-routines
) dl-support enbl-secure dl-origin \
42 shared-only-routines
+= dl-caller
44 # ld.so uses those routines, plus some special stuff for being the program
45 # interpreter and operating independent of libc.
46 rtld-routines
= rtld
$(all-dl-routines
) dl-sysdep dl-environ dl-minimal
47 all-rtld-routines
= $(rtld-routines
) $(sysdep-rtld-routines
)
49 CFLAGS-dl-runtime.c
= -fexceptions
-fasynchronous-unwind-tables
50 CFLAGS-dl-lookup.c
= -fexceptions
-fasynchronous-unwind-tables
51 CFLAGS-dl-iterate-phdr.c
= $(uses-callbacks
)
53 ifeq ($(unwind-find-fde
),yes
)
54 routines
+= unwind-dw2-fde-glibc
55 shared-only-routines
+= unwind-dw2-fde-glibc
58 before-compile
+= $(objpfx
)trusted-dirs.h
59 generated
+= trusted-dirs.h trusted-dirs.st for-renamed
/renamed.so
60 generated-dirs
+= for-renamed
62 ifeq ($(build-shared
),yes
)
63 ld-map
= $(common-objpfx
)ld.map
66 ifeq (yes
,$(build-shared
))
67 extra-objs
= $(all-rtld-routines
:%=%.os
) soinit.os sofini.os interp.os
68 generated
+= librtld.os dl-allobjs.os
ld.so ldd
69 install-others
= $(inst_rtlddir
)/$(rtld-installed-name
)
70 install-bin-script
= ldd
76 install-rootsbin
= sln
77 sln-modules
:= static-stubs
78 extra-objs
+= $(sln-modules
:=.o
)
80 ifeq (yes
,$(use-ldconfig
))
81 ifeq (yes
,$(build-shared
))
82 others-static
+= ldconfig
84 install-rootsbin
+= ldconfig
86 ldconfig-modules
:= cache readlib xmalloc xstrdup chroot_canon static-stubs
87 extra-objs
+= $(ldconfig-modules
:=.o
)
91 # To find xmalloc.c and xstrdup.c
92 vpath
%.c ..
/locale
/programs
94 ifeq ($(build-shared
),yes
)
95 extra-objs
+= sotruss-lib.os sotruss-lib.so
96 install-others
+= $(inst_auditdir
)/sotruss-lib.so
97 install-bin-script
+= sotruss
99 libof-sotruss-lib
= extramodules
100 $(objpfx
)sotruss-lib.so
: $(objpfx
)sotruss-lib.os
101 $(build-module-asneeded
)
102 $(objpfx
)sotruss-lib.so
: $(common-objpfx
)libc.so
$(objpfx
)ld.so \
103 $(common-objpfx
)libc_nonshared.a
105 $(objpfx
)sotruss
: sotruss.sh
$(common-objpfx
)config.make
106 sed
-e
's%@BASH@%$(BASH)%g' \
107 -e
's%@VERSION@%$(version)%g' \
108 -e
's%@TEXTDOMAINDIR@%$(msgcatdir)%g' \
109 -e
's%@PREFIX@%$(prefix)%g' \
110 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
111 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
115 $(inst_auditdir
)/sotruss-lib.so
: $(objpfx
)sotruss-lib.so
$(+force)
116 $(do-install-program
)
119 tests
= tst-tls1 tst-tls2 tst-tls9 tst-leaks1 \
120 tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 \
122 tests-static
= tst-tls1-static tst-tls2-static tst-stackguard1-static \
123 tst-leaks1-static tst-array1-static tst-array5-static \
124 tst-ptrguard1-static tst-dl-iter-static \
125 tst-tlsalign-static tst-tlsalign-extern-static
126 ifeq (yes
,$(build-shared
))
127 tests-static
+= tst-tls9-static
128 tst-tls9-static-ENV
= \
129 LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
):$(common-objpfx
)dlfcn
131 tests
+= $(tests-static
)
132 ifeq (yes
,$(build-shared
))
133 tests
+= loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
134 constload1 order noload
filter unload \
135 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
136 nodlopen nodlopen2 neededtest neededtest2 \
137 neededtest3 neededtest4 unload2 lateglobal initfirst global \
138 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
139 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
140 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
141 tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \
142 tst-align tst-align2
$(tests-execstack-
$(have-z-execstack
)) \
143 tst-dlmodcount tst-dlopenrpath tst-deep1 \
144 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
145 unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
146 tst-audit1 tst-audit2 tst-audit8 tst-audit9 \
147 tst-stackguard1 tst-addr1 tst-thrlock \
148 tst-unique1 tst-unique2
$(if
$(CXX
),tst-unique3 tst-unique4
) \
149 tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
150 tst-ptrguard1 tst-tlsalign tst-tlsalign-extern
152 ifeq ($(build-hardcoded-path-in-tests
),yes
)
153 tests
+= tst-dlopen-aout
154 LDFLAGS-tst-dlopen-aout
= $(no-pie-ldflag
)
156 test-srcs
= tst-pathopt
157 selinux-enabled
:= $(shell cat
/selinux
/enforce
2> /dev
/null
)
158 ifneq ($(selinux-enabled
),1)
159 tests-execstack-yes
= tst-execstack tst-execstack-needed tst-execstack-prog
162 ifeq ($(run-built-tests
),yes
)
163 tests-special
+= $(objpfx
)tst-leaks1-mem.out \
164 $(objpfx
)tst-leaks1-static-mem.out
$(objpfx
)noload-mem.out
166 tlsmod17a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
167 tlsmod18a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
168 tlsmod17a-modules
= $(addprefix tst-tlsmod17a
, $(tlsmod17a-suffixes
))
169 tlsmod18a-modules
= $(addprefix tst-tlsmod18a
, $(tlsmod17a-suffixes
))
170 extra-test-objs
+= $(tlsmod17a-modules
:=.os
) $(tlsmod18a-modules
:=.os
)
171 test-extras
+= tst-tlsmod17a tst-tlsmod18a
172 modules-names
= testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
173 testobj1_1 failobj constload2 constload3 unloadmod \
174 dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
175 nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
176 nodel2mod1 nodel2mod2 nodel2mod3 \
177 nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
178 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
179 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
180 neededobj1 neededobj2 neededobj3 neededobj4 \
181 neededobj5 neededobj6 firstobj globalmod1 \
182 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \
183 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \
184 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \
185 reldep7mod1 reldep7mod2 \
186 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \
187 tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
188 tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
189 tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
190 tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
191 $(tlsmod17a-modules
) tst-tlsmod17b
$(tlsmod18a-modules
) \
192 tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \
193 circlemod1 circlemod1a circlemod2 circlemod2a \
194 circlemod3 circlemod3a \
195 reldep8mod1 reldep8mod2 reldep8mod3 \
196 reldep9mod1 reldep9mod2 reldep9mod3 \
197 tst-alignmod tst-alignmod2 \
198 $(modules-execstack-
$(have-z-execstack
)) \
199 tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \
200 tst-dlmopen1mod tst-auditmod1 \
201 unload3mod1 unload3mod2 unload3mod3 unload3mod4 \
202 unload4mod1 unload4mod2 unload4mod3 unload4mod4 \
203 unload6mod1 unload6mod2 unload6mod3 \
204 unload7mod1 unload7mod2 \
205 unload8mod1 unload8mod1x unload8mod2 unload8mod3 \
206 order2mod1 order2mod2 order2mod3 order2mod4 \
207 tst-unique1mod1 tst-unique1mod2 \
208 tst-unique2mod1 tst-unique2mod2 \
209 tst-auditmod9a tst-auditmod9b \
210 $(if
$(CXX
),tst-unique3lib tst-unique3lib2 tst-unique4lib
) \
211 tst-initordera1 tst-initorderb1 \
212 tst-initordera2 tst-initorderb2 \
213 tst-initordera3 tst-initordera4 \
214 tst-initorder2a tst-initorder2b tst-initorder2c \
216 tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
217 tst-array5dep tst-null-argv-lib \
219 ifeq (yes
,$(have-protected-data
))
220 modules-names
+= tst-protected1moda tst-protected1modb
221 tests
+= tst-protected1a tst-protected1b
222 $(objpfx
)tst-protected1a
: $(addprefix $(objpfx
),tst-protected1moda.so tst-protected1modb.so
)
223 $(objpfx
)tst-protected1b
: $(addprefix $(objpfx
),tst-protected1modb.so tst-protected1moda.so
)
224 tst-protected1modb.so-no-z-defs
= yes
226 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
227 modules-names
+= tst-piemod1
228 tests
+= tst-pie1 tst-pie2
229 tests-pie
+= tst-pie1 tst-pie2
232 CFLAGS-vismain.c
= $(PIE-ccflag
)
234 modules-execstack-yes
= tst-execstack-mod
235 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
236 # We need this variable to be sure the test modules get the right CPPFLAGS.
237 test-extras
+= $(modules-names
)
239 # filtmod1.so has a special rule
240 modules-names-nobuild
:= filtmod1
242 ifneq (no
,$(multi-arch
))
243 tests-static
+= ifuncmain1static ifuncmain1picstatic \
244 ifuncmain2static ifuncmain2picstatic \
245 ifuncmain4static ifuncmain4picstatic \
246 ifuncmain5static ifuncmain5picstatic \
247 ifuncmain7static ifuncmain7picstatic
249 ifeq (yes
,$(build-shared
))
250 tests
+= ifuncmain1 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \
251 ifuncmain1staticpic \
252 ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \
253 ifuncmain5 ifuncmain5pic ifuncmain5staticpic \
254 ifuncmain7 ifuncmain7pic
255 ifunc-test-modules
= ifuncdep1 ifuncdep1pic ifuncdep2 ifuncdep2pic \
256 ifuncdep5 ifuncdep5pic
257 extra-test-objs
+= $(ifunc-test-modules
:=.o
)
258 test-extras
+= $(ifunc-test-modules
)
259 ifeq (yes
,$(have-fpie
))
260 ifunc-pie-tests
= ifuncmain1pie ifuncmain1vispie ifuncmain1staticpie \
261 ifuncmain5pie ifuncmain6pie ifuncmain7pie
262 tests
+= $(ifunc-pie-tests
)
263 tests-pie
+= $(ifunc-pie-tests
)
265 modules-names
+= ifuncmod1 ifuncmod3 ifuncmod5 ifuncmod6
269 ifeq (yes
,$(build-shared
))
270 ifeq ($(run-built-tests
),yes
)
271 tests-special
+= $(objpfx
)tst-pathopt.out
$(objpfx
)tst-rtld-load-self.out
273 tests-special
+= $(objpfx
)check-textrel.out
$(objpfx
)check-execstack.out \
274 $(objpfx
)check-localplt.out
277 ifeq ($(run-built-tests
),yes
)
278 tests-special
+= $(objpfx
)order-cmp.out
$(objpfx
)tst-array1-cmp.out \
279 $(objpfx
)tst-array1-static-cmp.out \
280 $(objpfx
)tst-array2-cmp.out
$(objpfx
)tst-array3-cmp.out \
281 $(objpfx
)tst-array4-cmp.out
$(objpfx
)tst-array5-cmp.out \
282 $(objpfx
)tst-array5-static-cmp.out
$(objpfx
)order2-cmp.out \
283 $(objpfx
)tst-initorder-cmp.out \
284 $(objpfx
)tst-initorder2-cmp.out
$(objpfx
)tst-unused-dep.out \
285 $(objpfx
)tst-unused-dep-cmp.out
288 check-abi
: $(objpfx
)check-abi-ld.out
289 tests-special
+= $(objpfx
)check-abi-ld.out
290 update-abi
: update-abi-ld
294 ifeq (yes
,$(build-shared
))
295 # Make sure these things are built in the `make lib' pass so they can be used
296 # to run programs during the `make others' pass.
297 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
298 $(addprefix $(objpfx
),$(extra-objs
))
301 # Command to link into a larger single relocatable object.
302 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
304 $(objpfx
)sotruss-lib.so
: $(shlib-lds
)
306 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
307 $(reloc-link
) -o
$@
$^
309 # Link together the dynamic linker into a single relocatable object.
310 # First we do a link against libc_pic.a just to get a link map,
311 # and discard the object produced by that link. From the link map
312 # we can glean all the libc modules that need to go into the dynamic
313 # linker. Then we do a recursive make that goes into all the subdirs
314 # those modules come from and builds special rtld-foo.os versions that
315 # are compiled with special flags, and puts these modules into rtld-libc.a
316 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
318 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
320 $(reloc-link
) -o
$@.o
'-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
324 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
326 sed
-n
's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
328 while read lib file
; do \
331 LC_ALL
=C fgrep
-l
/$$file \
332 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
334 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
337 echo rtld-
$${lib
%%/*} += $$file ;; \
338 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
341 echo rtld-subdirs
= `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
342 | LC_ALL=C sort -u` >> $@T
345 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
346 $(MAKE
) -f
$< -f rtld-Rules
348 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
349 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)' \
352 generated
+= librtld.map librtld.mk rtld-libc.a librtld.os.map
354 z-now-yes
= -Wl
,-z
,now
356 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
357 # Link into a temporary file so that we don't touch $@ at all
358 # if the sanity check below fails.
359 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
360 $(LDFLAGS-rtld
) -Wl
,-z
,defs
$(z-now-
$(bind-now
)) \
361 $(filter-out $(map-file
),$^
) $(load-map-file
) \
362 -Wl
,-soname
=$(rtld-installed-name
) \
364 $(call after-link
,$@.new
)
365 $(READELF
) -s
$@.new \
366 |
$(AWK
) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
369 ifeq (yes
,$(build-shared
))
370 # interp.c exists just to get the runtime linker path into libc.so.
371 $(objpfx
)interp.os
: $(common-objpfx
)runtime-linker.h
374 ifneq (ld.so
,$(rtld-installed-name
))
375 # Make sure ld.so.1 exists in the build directory so we can link
377 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
380 generated
+= $(rtld-installed-name
)
383 # Build a file mentioning all trustworthy directories to look for shared
384 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
385 # add directories to the list by defining $(user-defined-trusted-dirs)
386 # before starting make.
387 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
388 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
389 $(make-target-directory
)
390 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
391 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
392 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
393 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
395 CPPFLAGS-dl-load.c
= -I
$(objpfx
).
-I
$(csu-objpfx
).
397 ifeq (yes
,$(build-shared
))
398 $(inst_slibdir
)/$(rtld-version-installed-name
): $(objpfx
)ld.so
$(+force)
399 $(make-target-directory
)
400 $(do-install-program
)
402 $(inst_rtlddir
)/$(rtld-installed-name
): \
403 $(inst_slibdir
)/$(rtld-version-installed-name
) \
404 $(inst_slibdir
)/libc-
$(version
).so
405 $(make-target-directory
)
408 # Special target called by parent to install just the dynamic linker.
410 ldso_install
: $(inst_rtlddir
)/$(rtld-installed-name
)
414 ldd-rewrite
= -e
's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
415 -e
's%@VERSION@%$(version)%g' \
416 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
417 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
418 -e
's%@BASH@%$(BASH)%g' \
419 -e
's%@TEXTDOMAINDIR@%$(msgcatdir)%g'
421 ifeq ($(ldd-rewrite-script
),no
)
423 LC_ALL
=C sed
$(ldd-rewrite
) < $< > $@.new
427 LC_ALL
=C sed
$(ldd-rewrite
) < $< \
428 | LC_ALL
=C sed
-f
$(patsubst $(..
)/%,/%,$(..
)$(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
)sln
: $(sln-modules
:%=$(objpfx
)%.o
)
442 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
444 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
445 CFLAGS-ldconfig.c
= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' \
446 -D
'SLIBDIR="$(slibdir)"'
447 libof-ldconfig
= ldconfig
448 CFLAGS-dl-cache.c
= $(SYSCONF-FLAGS
)
449 CFLAGS-cache.c
= $(SYSCONF-FLAGS
)
450 CFLAGS-rtld.c
= $(SYSCONF-FLAGS
)
452 cpp-srcs-left
:= $(all-rtld-routines
:=.os
)
454 include $(patsubst %,$(..
)cppflags-iterator.mk
,$(cpp-srcs-left
))
456 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
457 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
459 $(objpfx
)testobj1.so
: $(libdl
)
460 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
$(libdl
)
461 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
$(libdl
)
462 $(objpfx
)testobj3.so
: $(libdl
)
463 $(objpfx
)testobj4.so
: $(libdl
)
464 $(objpfx
)testobj5.so
: $(libdl
)
465 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
$(libdl
)
466 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
467 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
468 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
469 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
470 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
471 $(objpfx
)nextmod1.so
: $(libdl
)
472 $(objpfx
)neededobj1.so
: $(libdl
)
473 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
$(libdl
)
474 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
$(libdl
)
475 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
476 $(objpfx
)neededobj3.so
$(libdl
)
477 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
478 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
479 $(objpfx
)ltglobmod2.so
: $(libdl
)
480 $(objpfx
)firstobj.so
: $(shared-thread-library
)
481 $(objpfx
)globalmod1.so
: $(libdl
)
482 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
483 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
484 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
485 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
486 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
487 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
488 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
489 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
490 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
491 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
492 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
493 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
494 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
495 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
496 $(objpfx
)tst-tlsmod13a.so
: $(objpfx
)tst-tlsmod13.so
497 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
498 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
499 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
500 $(objpfx
)tst-tls19mod1.so
: $(objpfx
)tst-tls19mod2.so
$(objpfx
)tst-tls19mod3.so
501 $(objpfx
)tst-tls19mod3.so
: $(objpfx
)ld.so
502 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
503 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
504 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
505 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
506 $(objpfx
)unload3mod1.so
: $(objpfx
)unload3mod3.so
507 $(objpfx
)unload3mod2.so
: $(objpfx
)unload3mod3.so
508 $(objpfx
)unload3mod3.so
: $(objpfx
)unload3mod4.so
509 $(objpfx
)unload4mod1.so
: $(objpfx
)unload4mod2.so
$(objpfx
)unload4mod3.so
510 $(objpfx
)unload4mod2.so
: $(objpfx
)unload4mod4.so
$(objpfx
)unload4mod3.so
511 $(objpfx
)unload6mod1.so
: $(libdl
)
512 $(objpfx
)unload6mod2.so
: $(libdl
)
513 $(objpfx
)unload6mod3.so
: $(libdl
)
514 $(objpfx
)unload7mod1.so
: $(libdl
)
515 $(objpfx
)unload7mod2.so
: $(objpfx
)unload7mod1.so
516 $(objpfx
)unload8mod1.so
: $(objpfx
)unload8mod2.so
517 $(objpfx
)unload8mod2.so
: $(objpfx
)unload8mod3.so
518 $(objpfx
)unload8mod3.so
: $(libdl
)
519 $(objpfx
)tst-initordera2.so
: $(objpfx
)tst-initordera1.so
520 $(objpfx
)tst-initorderb2.so
: $(objpfx
)tst-initorderb1.so
$(objpfx
)tst-initordera2.so
521 $(objpfx
)tst-initordera3.so
: $(objpfx
)tst-initorderb2.so
$(objpfx
)tst-initorderb1.so
522 $(objpfx
)tst-initordera4.so
: $(objpfx
)tst-initordera3.so
523 $(objpfx
)tst-initorder
: $(objpfx
)tst-initordera4.so
$(objpfx
)tst-initordera1.so
$(objpfx
)tst-initorderb2.so
524 $(objpfx
)tst-null-argv
: $(objpfx
)tst-null-argv-lib.so
525 $(objpfx
)tst-tlsalign
: $(objpfx
)tst-tlsalign-lib.so
527 # BZ#18383: broken on at least ARM (both).
528 test-xfail-tst-tlsalign
= yes
529 test-xfail-tst-tlsalign-static
= yes
531 $(objpfx
)tst-tlsalign-extern
: $(objpfx
)tst-tlsalign-vars.o
532 $(objpfx
)tst-tlsalign-extern-static
: $(objpfx
)tst-tlsalign-vars.o
534 tst-null-argv-ENV
= LD_DEBUG
=all LD_DEBUG_OUTPUT
=$(objpfx
)tst-null-argv.debug.out
535 LDFLAGS-nodel2mod3.so
= $(no-as-needed
)
536 LDFLAGS-reldepmod5.so
= $(no-as-needed
)
537 LDFLAGS-reldep6mod1.so
= $(no-as-needed
)
538 LDFLAGS-reldep6mod4.so
= $(no-as-needed
)
539 LDFLAGS-reldep8mod3.so
= $(no-as-needed
)
540 LDFLAGS-unload4mod1.so
= $(no-as-needed
)
541 LDFLAGS-unload4mod2.so
= $(no-as-needed
)
542 LDFLAGS-tst-initorder
= $(no-as-needed
)
543 LDFLAGS-tst-initordera2.so
= $(no-as-needed
)
544 LDFLAGS-tst-initordera3.so
= $(no-as-needed
)
545 LDFLAGS-tst-initordera4.so
= $(no-as-needed
)
546 LDFLAGS-tst-initorderb2.so
= $(no-as-needed
)
547 LDFLAGS-tst-tlsmod5.so
= -nostdlib
$(no-as-needed
)
548 LDFLAGS-tst-tlsmod6.so
= -nostdlib
$(no-as-needed
)
550 testobj1.so-no-z-defs
= yes
551 testobj3.so-no-z-defs
= yes
552 testobj4.so-no-z-defs
= yes
553 testobj5.so-no-z-defs
= yes
554 testobj6.so-no-z-defs
= yes
555 failobj.so-no-z-defs
= yes
556 constload2.so-no-z-defs
= yes
557 constload3.so-no-z-defs
= yes
558 nodelmod1.so-no-z-defs
= yes
559 nodelmod2.so-no-z-defs
= yes
560 nodelmod4.so-no-z-defs
= yes
561 nodel2mod2.so-no-z-defs
= yes
562 reldepmod2.so-no-z-defs
= yes
563 reldepmod3.so-no-z-defs
= yes
564 reldepmod4.so-no-z-defs
= yes
565 reldep4mod4.so-no-z-defs
= yes
566 reldep4mod2.so-no-z-defs
= yes
567 ltglobmod2.so-no-z-defs
= yes
568 dblloadmod3.so-no-z-defs
= yes
569 tst-tlsmod1.so-no-z-defs
= yes
570 tst-tlsmod2.so-no-z-defs
= yes
571 tst-tlsmod3.so-no-z-defs
= yes
572 tst-tlsmod4.so-no-z-defs
= yes
573 tst-tlsmod7.so-no-z-defs
= yes
574 tst-tlsmod8.so-no-z-defs
= yes
575 tst-tlsmod9.so-no-z-defs
= yes
576 tst-tlsmod10.so-no-z-defs
= yes
577 tst-tlsmod12.so-no-z-defs
= yes
578 tst-tlsmod14a.so-no-z-defs
= yes
579 tst-tlsmod14b.so-no-z-defs
= yes
580 tst-tlsmod15a.so-no-z-defs
= yes
581 tst-tlsmod16b.so-no-z-defs
= yes
582 circlemod2.so-no-z-defs
= yes
583 circlemod3.so-no-z-defs
= yes
584 circlemod3a.so-no-z-defs
= yes
585 reldep8mod2.so-no-z-defs
= yes
586 reldep9mod1.so-no-z-defs
= yes
587 unload3mod4.so-no-z-defs
= yes
588 unload4mod1.so-no-z-defs
= yes
589 ifuncmod1.so-no-z-defs
= yes
590 ifuncmod5.so-no-z-defs
= yes
591 ifuncmod6.so-no-z-defs
= yes
592 tst-auditmod9a.so-no-z-defs
= yes
593 tst-auditmod9b.so-no-z-defs
= yes
595 ifeq ($(build-shared
),yes
)
596 # Build all the modules even when not actually running test programs.
597 tests
: $(test-modules
)
600 $(objpfx
)loadtest
: $(libdl
)
601 LDFLAGS-loadtest
= -rdynamic
603 $(objpfx
)loadtest.out
: $(test-modules
)
605 $(objpfx
)neededtest
: $(libdl
)
606 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
607 $(objpfx
)neededobj3.so
609 $(objpfx
)neededtest2
: $(libdl
)
610 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
611 $(objpfx
)neededobj3.so
613 $(objpfx
)neededtest3
: $(libdl
)
614 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
615 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
617 $(objpfx
)neededtest4
: $(libdl
) $(objpfx
)neededobj1.so
618 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
620 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
$(libdl
)
621 LDFLAGS-restest1
= -rdynamic
623 $(objpfx
)restest2
: $(libdl
)
624 LDFLAGS-restest2
= -rdynamic
626 $(objpfx
)restest1.out
: $(test-modules
)
628 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
629 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
630 LDFLAGS-preloadtest
= -rdynamic
631 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
633 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
635 $(objpfx
)loadfail
: $(libdl
)
636 LDFLAGS-loadfail
= -rdynamic
638 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
640 $(objpfx
)multiload
: $(libdl
)
641 LDFLAGS-multiload
= -rdynamic
642 CFLAGS-multiload.c
= -DOBJDIR
=\"$(elf-objpfx
)\"
644 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
646 $(objpfx
)origtest
: $(libdl
)
647 LDFLAGS-origtest
= -rdynamic
648 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
650 ifeq ($(have-thread-library
),yes
)
651 $(objpfx
)resolvfail
: $(libdl
) $(shared-thread-library
)
653 $(objpfx
)resolvfail
: $(libdl
)
656 $(objpfx
)constload1
: $(libdl
)
657 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
659 $(objpfx
)circleload1
: $(libdl
)
660 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
661 $(objpfx
)circlemod1a.so
663 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
664 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
665 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
666 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
668 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
670 $(objpfx
)order-cmp.out
: $(objpfx
)order.out
671 (echo
"0123456789" | cmp
$< -) > $@
; \
674 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
675 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
676 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
678 $(objpfx
)noload
: $(objpfx
)testobj1.so
$(libdl
)
679 LDFLAGS-noload
= -rdynamic
$(no-as-needed
)
680 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
682 $(objpfx
)noload-mem.out
: $(objpfx
)noload.out
683 $(common-objpfx
)malloc
/mtrace
$(objpfx
)noload.mtrace
> $@
; \
685 noload-ENV
= MALLOC_TRACE
=$(objpfx
)noload.mtrace
687 LDFLAGS-nodelete
= -rdynamic
688 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
689 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
690 $(objpfx
)nodelete
: $(libdl
)
691 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
692 $(objpfx
)nodelmod3.so
694 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
695 $(objpfx
)nodlopen
: $(libdl
)
696 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
698 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
699 $(objpfx
)nodlopen2
: $(libdl
)
700 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
702 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
703 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
704 -L
$(subst :, -L
,$(rpath-link
)) \
705 -Wl
,-rpath-link
=$(rpath-link
) \
706 $< -Wl
,-F
,$(objpfx
)filtmod2.so
707 $(objpfx
)filter: $(objpfx
)filtmod1.so
709 $(objpfx
)unload
: $(libdl
)
710 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
712 $(objpfx
)reldep
: $(libdl
)
713 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
715 $(objpfx
)reldep2
: $(libdl
)
716 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
718 $(objpfx
)reldep3
: $(libdl
)
719 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
721 $(objpfx
)reldep4
: $(libdl
)
722 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
724 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
$(libdl
)
725 LDFLAGS-next
= $(no-as-needed
)
727 $(objpfx
)unload2
: $(libdl
)
728 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
730 $(objpfx
)lateglobal
: $(libdl
)
731 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
733 $(objpfx
)tst-pathopt
: $(libdl
)
734 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
735 $(objpfx
)pathoptobj.so
736 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
737 '$(run-program-env)'; \
740 $(objpfx
)tst-rtld-load-self.out
: tst-rtld-load-self.sh
$(objpfx
)ld.so
741 $(SHELL
) $^
'$(test-wrapper)' '$(test-wrapper-env)' > $@
; \
744 $(objpfx
)initfirst
: $(libdl
)
745 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
747 $(objpfx
)global
: $(objpfx
)globalmod1.so
748 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
750 $(objpfx
)dblload
: $(libdl
)
751 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
753 $(objpfx
)dblunload
: $(libdl
)
754 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
756 $(objpfx
)reldep5
: $(libdl
)
757 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod6.so
759 $(objpfx
)reldep6
: $(libdl
)
760 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
762 $(objpfx
)reldep7
: $(libdl
)
763 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
765 $(objpfx
)reldep8
: $(libdl
)
766 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
768 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
769 $(objpfx
)nodelete2
: $(libdl
)
770 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
772 $(objpfx
)reldep9
: $(libdl
)
773 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
775 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
777 $(objpfx
)tst-tls4
: $(libdl
)
778 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
780 $(objpfx
)tst-tls5
: $(libdl
)
781 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
783 $(objpfx
)tst-tls6
: $(libdl
)
784 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
786 $(objpfx
)tst-tls7
: $(libdl
)
787 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
789 $(objpfx
)tst-tls8
: $(libdl
)
790 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
792 $(objpfx
)tst-tls9
: $(libdl
)
793 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
795 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
$(objpfx
)tst-tlsmod7.so
797 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
$(objpfx
)tst-tlsmod9.so
799 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
$(objpfx
)tst-tlsmod11.so
801 $(objpfx
)tst-tls13
: $(libdl
)
802 $(objpfx
)tst-tls13.out
: $(objpfx
)tst-tlsmod13a.so
804 $(objpfx
)tst-tls14
: $(objpfx
)tst-tlsmod14a.so
$(libdl
)
805 $(objpfx
)tst-tls14.out
: $(objpfx
)tst-tlsmod14b.so
807 $(objpfx
)tst-tls15
: $(libdl
)
808 $(objpfx
)tst-tls15.out
: $(objpfx
)tst-tlsmod15a.so
$(objpfx
)tst-tlsmod15b.so
810 $(objpfx
)tst-tls-dlinfo
: $(libdl
)
811 $(objpfx
)tst-tls-dlinfo.out
: $(objpfx
)tst-tlsmod2.so
815 $(objpfx
)tst-tls16
: $(libdl
)
816 $(objpfx
)tst-tls16.out
: $(objpfx
)tst-tlsmod16a.so
$(objpfx
)tst-tlsmod16b.so
818 $(objpfx
)tst-tls17
: $(libdl
)
819 $(objpfx
)tst-tls17.out
: $(objpfx
)tst-tlsmod17b.so
820 $(patsubst %,$(objpfx
)%.os
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.os
: tst-tlsmod17a.c
821 $(compile-command.c
) -DN
=$*
822 $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.so
: $(objpfx
)ld.so
823 $(objpfx
)tst-tlsmod17b.so
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
))
825 $(objpfx
)tst-tls18
: $(libdl
)
826 $(objpfx
)tst-tls18.out
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
))
827 $(patsubst %,$(objpfx
)%.os
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.os
: tst-tlsmod18a.c
828 $(compile-command.c
) -DN
=$*
829 $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.so
: $(objpfx
)ld.so
831 $(objpfx
)tst-tls19
: $(libdl
)
832 $(objpfx
)tst-tls19.out
: $(objpfx
)tst-tls19mod1.so
834 CFLAGS-tst-align.c
= $(stack-align-test-flags
)
835 CFLAGS-tst-align2.c
= $(stack-align-test-flags
)
836 CFLAGS-tst-alignmod.c
= $(stack-align-test-flags
)
837 CFLAGS-tst-alignmod2.c
= $(stack-align-test-flags
)
838 $(objpfx
)tst-align
: $(libdl
)
839 $(objpfx
)tst-align.out
: $(objpfx
)tst-alignmod.so
840 $(objpfx
)tst-align2
: $(objpfx
)tst-alignmod2.so
842 $(objpfx
)unload3
: $(libdl
)
843 $(objpfx
)unload3.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
844 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
846 $(objpfx
)unload4
: $(libdl
)
847 $(objpfx
)unload4.out
: $(objpfx
)unload4mod1.so
$(objpfx
)unload4mod3.so
849 $(objpfx
)unload5
: $(libdl
)
850 $(objpfx
)unload5.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
851 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
853 $(objpfx
)unload6
: $(libdl
)
854 $(objpfx
)unload6.out
: $(objpfx
)unload6mod1.so
$(objpfx
)unload6mod2.so \
855 $(objpfx
)unload6mod3.so
857 $(objpfx
)unload7
: $(libdl
)
858 $(objpfx
)unload7.out
: $(objpfx
)unload7mod1.so
$(objpfx
)unload7mod2.so
859 unload7-ENV
= MALLOC_PERTURB_
=85
861 $(objpfx
)unload8
: $(libdl
)
862 $(objpfx
)unload8.out
: $(objpfx
)unload8mod1.so
$(objpfx
)unload8mod1x.so
865 $(objpfx
)tst-tls9-static
: $(common-objpfx
)dlfcn
/libdl.a
866 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
869 ifeq ($(have-z-execstack
),yes
)
870 $(objpfx
)tst-execstack
: $(libdl
)
871 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
872 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
873 LDFLAGS-tst-execstack-mod
= -Wl
,-z
,execstack
875 $(objpfx
)tst-execstack-needed
: $(objpfx
)tst-execstack-mod.so
876 LDFLAGS-tst-execstack-needed
= -Wl
,-z
,noexecstack
878 LDFLAGS-tst-execstack-prog
= -Wl
,-z
,execstack
879 CFLAGS-tst-execstack-prog.c
+= -Wno-trampolines
880 CFLAGS-tst-execstack-mod.c
+= -Wno-trampolines
883 LDFLAGS-tst-array2
= $(no-as-needed
)
884 LDFLAGS-tst-array5
= $(no-as-needed
)
886 $(objpfx
)tst-array1-cmp.out
: tst-array1.exp
$(objpfx
)tst-array1.out
890 $(objpfx
)tst-array1-static-cmp.out
: tst-array1.exp \
891 $(objpfx
)tst-array1-static.out
895 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
896 $(objpfx
)tst-array2-cmp.out
: tst-array2.exp
$(objpfx
)tst-array2.out
900 $(objpfx
)tst-array3-cmp.out
: tst-array1.exp
$(objpfx
)tst-array3.out
904 $(objpfx
)tst-array4
: $(libdl
)
905 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array2dep.so
906 $(objpfx
)tst-array4-cmp.out
: tst-array4.exp
$(objpfx
)tst-array4.out
910 $(objpfx
)tst-array5
: $(objpfx
)tst-array5dep.so
911 $(objpfx
)tst-array5-cmp.out
: tst-array5.exp
$(objpfx
)tst-array5.out
915 $(objpfx
)tst-array5-static-cmp.out
: tst-array5-static.exp \
916 $(objpfx
)tst-array5-static.out
920 CFLAGS-tst-pie1.c
+= $(pie-ccflag
)
921 CFLAGS-tst-pie2.c
+= $(pie-ccflag
)
923 $(objpfx
)tst-pie1
: $(objpfx
)tst-piemod1.so
925 ifeq (yes
,$(build-shared
))
926 all-built-dso
:= $(common-objpfx
)elf
/ld.so
$(common-objpfx
)libc.so \
927 $(filter-out $(common-objpfx
)linkobj
/libc.so
, \
928 $(sort $(wildcard $(addprefix $(common-objpfx
), \
932 $(all-built-dso
:=.dyn
): %.dyn
: %
934 LC_ALL
=C
$(READELF
) -W
-d
$< > $@T
937 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dyn
)
939 $(objpfx
)check-textrel.out
: $(..
)scripts
/check-textrel.awk \
940 $(all-built-dso
:=.dyn
)
941 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
943 generated
+= check-textrel.out
945 $(objpfx
)execstack-default
: $(first-word
$(wildcard $(sysdirs
:%=%/stackinfo.h
)))
946 $(make-target-directory
)
947 { echo
'#include <elf.h>'; \
948 echo
'#include <stackinfo.h>'; \
949 echo
'#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
950 echo
'@@@execstack-no@@@'; \
952 echo
'@@@execstack-yes@@@'; \
954 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -E
-x c-header
- | \
955 sed
-n
-e
's/^@@@\(.*\)@@@/\1/p' > $@T
957 generated
+= execstack-default
959 $(all-built-dso
:=.phdr
): %.phdr
: %
961 LC_ALL
=C
$(READELF
) -W
-l
$< > $@T
964 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.phdr
)
966 $(objpfx
)check-execstack.out
: $(..
)scripts
/check-execstack.awk \
967 $(objpfx
)execstack-default \
968 $(all-built-dso
:=.phdr
)
969 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
971 generated
+= check-execstack.out
973 $(objpfx
)tst-dlmodcount
: $(libdl
)
974 $(objpfx
)tst-dlmodcount.out
: $(test-modules
)
976 $(all-built-dso
:=.jmprel
): %.jmprel
: % Makefile
978 LC_ALL
=C
$(READELF
) -W
-S
-d
-r
$< > $@T
981 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.jmprel
)
983 localplt-built-dso
:= $(addprefix $(common-objpfx
),\
989 resolv
/libresolv.so \
992 ifeq ($(build-mathvec
),yes
)
993 localplt-built-dso
+= $(addprefix $(common-objpfx
), mathvec
/libmvec.so
)
995 ifeq ($(have-thread-library
),yes
)
996 localplt-built-dso
+= $(filter-out %_nonshared.a
, $(shared-thread-library
))
999 vpath localplt.data
$(+sysdep_dirs
)
1001 $(objpfx
)check-localplt.out
: $(..
)scripts
/check-localplt.awk \
1002 $(..
)scripts
/localplt.awk \
1003 $(localplt-built-dso
:=.jmprel
) \
1005 LC_ALL
=C
$(AWK
) -f
$(filter-out $< %localplt.data
,$^
) | \
1006 LC_ALL
=C
$(AWK
) -f
$< $(filter %localplt.data
,$^
) - \
1011 $(objpfx
)tst-dlopenrpathmod.so
: $(libdl
)
1012 $(objpfx
)tst-dlopenrpath
: $(objpfx
)tst-dlopenrpathmod.so
$(libdl
)
1013 CFLAGS-tst-dlopenrpath.c
+= -DPFX
=\"$(objpfx
)\"
1014 LDFLAGS-tst-dlopenrpathmod.so
+= -Wl
,-rpath
,\
$$ORIGIN/test-subdir
1015 $(objpfx
)tst-dlopenrpath.out
: $(objpfx
)firstobj.so
1017 $(objpfx
)tst-deep1mod2.so
: $(objpfx
)tst-deep1mod3.so
1018 $(objpfx
)tst-deep1
: $(libdl
) $(objpfx
)tst-deep1mod1.so
1019 $(objpfx
)tst-deep1.out
: $(objpfx
)tst-deep1mod2.so
1020 LDFLAGS-tst-deep1
+= -rdynamic
1021 tst-deep1mod3.so-no-z-defs
= yes
1023 $(objpfx
)tst-dlmopen1mod.so
: $(libdl
)
1024 $(objpfx
)tst-dlmopen1
: $(libdl
)
1025 $(objpfx
)tst-dlmopen1.out
: $(objpfx
)tst-dlmopen1mod.so
1027 $(objpfx
)tst-dlmopen2
: $(libdl
)
1028 $(objpfx
)tst-dlmopen2.out
: $(objpfx
)tst-dlmopen1mod.so
1030 $(objpfx
)tst-dlmopen3
: $(libdl
)
1031 $(objpfx
)tst-dlmopen3.out
: $(objpfx
)tst-dlmopen1mod.so
1033 $(objpfx
)tst-audit1.out
: $(objpfx
)tst-auditmod1.so
1034 tst-audit1-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1036 $(objpfx
)tst-audit2
: $(libdl
)
1037 $(objpfx
)tst-audit2.out
: $(objpfx
)tst-auditmod1.so
$(objpfx
)tst-auditmod9b.so
1038 # Prevent GCC-5 from translating a malloc/memset pair into calloc
1039 CFLAGS-tst-audit2.c
+= -fno-builtin
1040 tst-audit2-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1042 $(objpfx
)tst-audit9
: $(libdl
)
1043 $(objpfx
)tst-audit9.out
: $(objpfx
)tst-auditmod9a.so
$(objpfx
)tst-auditmod9b.so
1044 tst-audit9-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod9a.so
1046 $(objpfx
)tst-audit8
: $(libm
)
1047 $(objpfx
)tst-audit8.out
: $(objpfx
)tst-auditmod1.so
1048 tst-audit8-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1050 $(objpfx
)tst-global1
: $(libdl
)
1051 $(objpfx
)tst-global1.out
: $(objpfx
)testobj6.so
$(objpfx
)testobj2.so
1053 $(objpfx
)order2
: $(libdl
)
1054 $(objpfx
)order2.out
: $(objpfx
)order2mod1.so
$(objpfx
)order2mod2.so
1055 $(objpfx
)order2-cmp.out
: $(objpfx
)order2.out
1056 (echo
"12345" | cmp
$< -) > $@
; \
1058 $(objpfx
)order2mod1.so
: $(objpfx
)order2mod4.so
1059 $(objpfx
)order2mod4.so
: $(objpfx
)order2mod3.so
1060 $(objpfx
)order2mod2.so
: $(objpfx
)order2mod3.so
1061 order2mod2.so-no-z-defs
= yes
1062 LDFLAGS-order2mod1.so
= $(no-as-needed
)
1063 LDFLAGS-order2mod2.so
= $(no-as-needed
)
1065 tst-stackguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
1066 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
1068 tst-ptrguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
1069 # When built statically, the pointer guard interface uses
1070 # __pointer_chk_guard_local.
1071 CFLAGS-tst-ptrguard1-static.c
= -DPTRGUARD_LOCAL
1072 tst-ptrguard1-static-ARGS
= --command
"$(objpfx)tst-ptrguard1-static --child"
1074 $(objpfx
)tst-leaks1
: $(libdl
)
1075 $(objpfx
)tst-leaks1-mem.out
: $(objpfx
)tst-leaks1.out
1076 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1.mtrace
> $@
; \
1079 $(objpfx
)tst-leaks1-static
: $(common-objpfx
)dlfcn
/libdl.a
1080 $(objpfx
)tst-leaks1-static-mem.out
: $(objpfx
)tst-leaks1-static.out
1081 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1-static.mtrace
> $@
; \
1084 tst-leaks1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1.mtrace
1085 tst-leaks1-static-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1-static.mtrace
1087 $(objpfx
)tst-addr1
: $(libdl
)
1089 $(objpfx
)tst-thrlock
: $(libdl
) $(shared-thread-library
)
1090 $(objpfx
)tst-dlopen-aout
: $(libdl
) $(shared-thread-library
)
1092 CFLAGS-ifuncmain1pic.c
+= $(pic-ccflag
)
1093 CFLAGS-ifuncmain1picstatic.c
+= $(pic-ccflag
)
1094 CFLAGS-ifuncmain1staticpic.c
+= $(pic-ccflag
)
1095 CFLAGS-ifuncdep1pic.c
+= $(pic-ccflag
)
1096 CFLAGS-ifuncmain1vispic.c
+= $(pic-ccflag
)
1097 CFLAGS-ifuncmain2pic.c
+= $(pic-ccflag
)
1098 CFLAGS-ifuncmain2picstatic.c
+= $(pic-ccflag
)
1099 CFLAGS-ifuncdep2pic.c
+= $(pic-ccflag
)
1100 CFLAGS-ifuncmain4picstatic.c
+= $(pic-ccflag
)
1101 CFLAGS-ifuncmain5pic.c
+= $(pic-ccflag
)
1102 CFLAGS-ifuncmain5picstatic.c
+= $(pic-ccflag
)
1103 CFLAGS-ifuncmain5staticpic.c
+= $(pic-ccflag
)
1104 CFLAGS-ifuncdep5pic.c
+= $(pic-ccflag
)
1105 CFLAGS-ifuncmain7pic.c
+= $(pic-ccflag
)
1106 CFLAGS-ifuncmain7picstatic.c
+= $(pic-ccflag
)
1108 LDFLAGS-ifuncmain3
= -Wl
,-export-dynamic
1110 CFLAGS-ifuncmain1pie.c
+= $(pie-ccflag
)
1111 CFLAGS-ifuncmain1vispie.c
+= $(pie-ccflag
)
1112 CFLAGS-ifuncmain1staticpie.c
+= $(pie-ccflag
)
1113 CFLAGS-ifuncmain5pie.c
+= $(pie-ccflag
)
1114 CFLAGS-ifuncmain6pie.c
+= $(pie-ccflag
)
1115 CFLAGS-ifuncmain7pie.c
+= $(pie-ccflag
)
1117 $(objpfx
)ifuncmain1pie
: $(objpfx
)ifuncmod1.so
1118 $(objpfx
)ifuncmain1staticpie
: $(objpfx
)ifuncdep1pic.o
1119 $(objpfx
)ifuncmain1vispie
: $(objpfx
)ifuncmod1.so
1120 $(objpfx
)ifuncmain5pie
: $(objpfx
)ifuncmod5.so
1121 $(objpfx
)ifuncmain6pie
: $(objpfx
)ifuncmod6.so
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 $(objpfx
)tst-unique3
: $(libdl
) $(objpfx
)tst-unique3lib.so
1152 $(objpfx
)tst-unique3.out
: $(objpfx
)tst-unique3lib2.so
1154 $(objpfx
)tst-unique4
: $(objpfx
)tst-unique4lib.so
1156 $(objpfx
)tst-initorder-cmp.out
: tst-initorder.exp
$(objpfx
)tst-initorder.out
1160 $(objpfx
)tst-initorder2
: $(objpfx
)tst-initorder2a.so
$(objpfx
)tst-initorder2d.so
$(objpfx
)tst-initorder2c.so
1161 $(objpfx
)tst-initorder2a.so
: $(objpfx
)tst-initorder2b.so
1162 $(objpfx
)tst-initorder2b.so
: $(objpfx
)tst-initorder2c.so
1163 $(objpfx
)tst-initorder2c.so
: $(objpfx
)tst-initorder2d.so
1164 LDFLAGS-tst-initorder2
= $(no-as-needed
)
1165 LDFLAGS-tst-initorder2a.so
= $(no-as-needed
)
1166 LDFLAGS-tst-initorder2b.so
= $(no-as-needed
)
1167 LDFLAGS-tst-initorder2c.so
= $(no-as-needed
)
1168 define o-iterator-doit
1169 $(objpfx
)tst-initorder2
$o.os
: tst-initorder2.c
; \
1170 $$(compile-command.c
) -DNAME
=\"$o\"
1172 object-suffixes-left
:= a b c d
1173 include $(o-iterator
)
1175 $(objpfx
)tst-initorder2-cmp.out
: tst-initorder2.exp
$(objpfx
)tst-initorder2.out
1179 $(objpfx
)tst-relsort1
: $(libdl
)
1180 $(objpfx
)tst-relsort1mod1.so
: $(libm
) $(objpfx
)tst-relsort1mod2.so
1181 $(objpfx
)tst-relsort1mod2.so
: $(libm
)
1182 $(objpfx
)tst-relsort1.out
: $(objpfx
)tst-relsort1mod1.so \
1183 $(objpfx
)tst-relsort1mod2.so
1185 $(objpfx
)tst-unused-dep.out
: $(objpfx
)testobj1.so
1186 $(test-wrapper-env
) \
1187 LD_TRACE_LOADED_OBJECTS
=1 \
1194 $(objpfx
)tst-unused-dep-cmp.out
: $(objpfx
)tst-unused-dep.out
1195 cmp
$< /dev
/null
> $@
; \