1 # Copyright (C) 1995-2018 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 dl-addr-obj enbl-secure dl-profstub \
27 dl-origin dl-libc dl-sym dl-sysdep dl-error \
30 # The core dynamic linking functions are in libc for the static and
32 dl-routines
= $(addprefix dl-
,load lookup object reloc deps hwcaps \
33 runtime init fini debug misc \
34 version profile tls
origin scope \
35 execstack open close trampoline \
37 ifeq (yes
,$(use-ldconfig
))
38 dl-routines
+= dl-cache
41 ifneq (no
,$(have-tunables
))
42 dl-routines
+= dl-tunables
43 tunables-type
= $(addprefix TUNABLES_FRONTEND_
,$(have-tunables
))
44 CPPFLAGS-dl-tunables.c
+= -DTUNABLES_FRONTEND
=$(tunables-type
)
46 # Make sure that the compiler does not insert any library calls in tunables
48 ifeq (yes
,$(have-loop-to-function
))
49 CFLAGS-dl-tunables.c
+= -fno-tree-loop-distribute-patterns
53 all-dl-routines
= $(dl-routines
) $(sysdep-dl-routines
)
54 # But they are absent from the shared libc, because that code is in ld.so.
55 elide-routines.os
= $(all-dl-routines
) dl-support enbl-secure dl-origin \
56 dl-sysdep dl-exception dl-reloc-static-pie
58 # ld.so uses those routines, plus some special stuff for being the program
59 # interpreter and operating independent of libc.
60 rtld-routines
= rtld
$(all-dl-routines
) dl-sysdep dl-environ dl-minimal \
61 dl-error-minimal dl-conflict
62 all-rtld-routines
= $(rtld-routines
) $(sysdep-rtld-routines
)
64 CFLAGS-dl-runtime.c
+= -fexceptions
-fasynchronous-unwind-tables
65 CFLAGS-dl-lookup.c
+= -fexceptions
-fasynchronous-unwind-tables
66 CFLAGS-dl-iterate-phdr.c
+= $(uses-callbacks
)
68 # Compile rtld itself without stack protection.
69 # Also compile all routines in the static library that are elided from
70 # the shared libc because they are in libc.a in the same way.
72 define elide-stack-protector
73 $(if
$(filter $(@F
),$(patsubst %,%$(1),$(2))), $(no-stack-protector
))
76 CFLAGS-.o
+= $(call elide-stack-protector
,.o
,$(elide-routines.os
))
77 CFLAGS-.op
+= $(call elide-stack-protector
,.op
,$(elide-routines.os
))
78 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,$(all-rtld-routines
))
80 ifeq ($(unwind-find-fde
),yes
)
81 routines
+= unwind-dw2-fde-glibc
82 shared-only-routines
+= unwind-dw2-fde-glibc
85 before-compile
+= $(objpfx
)trusted-dirs.h
86 generated
+= trusted-dirs.h trusted-dirs.st for-renamed
/renamed.so
87 generated-dirs
+= for-renamed
89 ifeq ($(build-shared
),yes
)
90 ld-map
= $(common-objpfx
)ld.map
93 ifeq (yes
,$(build-shared
))
94 extra-objs
= $(all-rtld-routines
:%=%.os
) soinit.os sofini.os interp.os
95 generated
+= librtld.os dl-allobjs.os
ld.so ldd
96 install-others
= $(inst_rtlddir
)/$(rtld-installed-name
)
97 install-bin-script
= ldd
103 install-rootsbin
= sln
104 sln-modules
:= static-stubs
105 extra-objs
+= $(sln-modules
:=.o
)
107 ifeq (yes
,$(use-ldconfig
))
108 ifeq (yes
,$(build-shared
))
109 others-static
+= ldconfig
111 install-rootsbin
+= ldconfig
113 ldconfig-modules
:= cache readlib xmalloc xstrdup chroot_canon static-stubs
114 extra-objs
+= $(ldconfig-modules
:=.o
)
115 others-extras
= $(ldconfig-modules
)
119 # To find xmalloc.c and xstrdup.c
120 vpath
%.c ..
/locale
/programs
122 ifeq ($(build-shared
),yes
)
123 extra-objs
+= sotruss-lib.os sotruss-lib.so
124 install-others
+= $(inst_auditdir
)/sotruss-lib.so
125 install-bin-script
+= sotruss
127 libof-sotruss-lib
= extramodules
128 $(objpfx
)sotruss-lib.so
: $(objpfx
)sotruss-lib.os
129 $(build-module-asneeded
)
130 $(objpfx
)sotruss-lib.so
: $(common-objpfx
)libc.so
$(objpfx
)ld.so \
131 $(common-objpfx
)libc_nonshared.a
133 $(objpfx
)sotruss
: sotruss.sh
$(common-objpfx
)config.make
134 sed
-e
's%@BASH@%$(BASH)%g' \
135 -e
's%@VERSION@%$(version)%g' \
136 -e
's%@TEXTDOMAINDIR@%$(localedir)%g' \
137 -e
's%@PREFIX@%$(prefix)%g' \
138 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
139 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
143 $(inst_auditdir
)/sotruss-lib.so
: $(objpfx
)sotruss-lib.so
$(+force)
144 $(do-install-program
)
147 tests-static-normal
:= tst-leaks1-static tst-array1-static tst-array5-static \
149 tst-tlsalign-static tst-tlsalign-extern-static \
150 tst-linkall-static tst-env-setuid tst-env-setuid-tunables
151 tests-static-internal
:= tst-tls1-static tst-tls2-static \
152 tst-ptrguard1-static tst-stackguard1-static \
153 tst-tls1-static-non-pie tst-libc_dlvsym-static
155 CRT-tst-tls1-static-non-pie
:= $(csu-objpfx
)crt1.o
156 tst-tls1-static-non-pie-no-pie
= yes
158 tests
:= tst-tls9 tst-leaks1 \
159 tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 \
161 tests-internal
:= tst-tls1 tst-tls2
$(tests-static-internal
)
162 tests-static
:= $(tests-static-normal
) $(tests-static-internal
)
164 ifeq (yes
,$(build-shared
))
165 tests-static
+= tst-tls9-static
166 tst-tls9-static-ENV
= \
167 LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
):$(common-objpfx
)dlfcn
169 tests
+= restest1 preloadtest loadfail multiload origtest resolvfail \
170 constload1 order noload
filter \
171 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
172 nodlopen nodlopen2 lateglobal initfirst global \
173 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
175 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
176 tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \
177 tst-align tst-align2 \
178 tst-dlmodcount tst-dlopenrpath tst-deep1 \
179 tst-dlmopen1 tst-dlmopen3 \
180 unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
181 tst-audit1 tst-audit2 tst-audit8 tst-audit9 \
182 tst-addr1 tst-thrlock \
183 tst-unique1 tst-unique2
$(if
$(CXX
),tst-unique3 tst-unique4 \
185 tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
186 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
187 tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload \
188 tst-latepthread tst-tls-manydynamic tst-nodelete-dlclose \
189 tst-debug1 tst-main1 tst-absolute-sym tst-absolute-zero tst-big-note \
190 tst-unwind-ctor tst-unwind-main
192 tests-internal
+= loadtest unload unload2 circleload1 \
193 neededtest neededtest2 neededtest3 neededtest4 \
194 tst-tls3 tst-tls6 tst-tls7 tst-tls8 tst-dlmopen2 \
195 tst-ptrguard1 tst-stackguard1 tst-libc_dlvsym \
197 ifeq ($(build-hardcoded-path-in-tests
),yes
)
198 tests
+= tst-dlopen-aout
199 tst-dlopen-aout-no-pie
= yes
201 test-srcs
= tst-pathopt
202 selinux-enabled
:= $(shell cat
/selinux
/enforce
2> /dev
/null
)
203 ifneq ($(selinux-enabled
),1)
204 tests-execstack-yes
= tst-execstack tst-execstack-needed tst-execstack-prog
207 tests
+= $(tests-execstack-
$(have-z-execstack
))
208 ifeq ($(run-built-tests
),yes
)
209 tests-special
+= $(objpfx
)tst-leaks1-mem.out \
210 $(objpfx
)tst-leaks1-static-mem.out
$(objpfx
)noload-mem.out \
211 $(objpfx
)tst-ldconfig-X.out
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 tlsmod17a-modules
= $(addprefix tst-tlsmod17a
, $(tlsmod17a-suffixes
))
216 tlsmod18a-modules
= $(addprefix tst-tlsmod18a
, $(tlsmod17a-suffixes
))
217 one-hundred
= $(foreach x
,0 1 2 3 4 5 6 7 8 9, \
218 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x)
219 tst-tls-many-dynamic-modules
:= \
220 $(foreach n
,$(one-hundred
),tst-tls-manydynamic
$(n
)mod
)
221 extra-test-objs
+= $(tlsmod17a-modules
:=.os
) $(tlsmod18a-modules
:=.os
) \
223 test-extras
+= tst-tlsmod17a tst-tlsmod18a tst-tlsalign-vars
224 modules-names
= testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
225 testobj1_1 failobj constload2 constload3 unloadmod \
226 dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
227 nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
228 nodel2mod1 nodel2mod2 nodel2mod3 \
229 nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
230 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
231 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
232 neededobj1 neededobj2 neededobj3 neededobj4 \
233 neededobj5 neededobj6 firstobj globalmod1 \
234 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \
235 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \
236 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \
237 reldep7mod1 reldep7mod2 \
238 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \
239 tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
240 tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
241 tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
242 tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
243 $(tlsmod17a-modules
) tst-tlsmod17b
$(tlsmod18a-modules
) \
244 tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \
245 circlemod1 circlemod1a circlemod2 circlemod2a \
246 circlemod3 circlemod3a \
247 reldep8mod1 reldep8mod2 reldep8mod3 \
248 reldep9mod1 reldep9mod2 reldep9mod3 \
249 tst-alignmod tst-alignmod2 \
250 $(modules-execstack-
$(have-z-execstack
)) \
251 tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \
252 tst-dlmopen1mod tst-auditmod1 \
253 unload3mod1 unload3mod2 unload3mod3 unload3mod4 \
254 unload4mod1 unload4mod2 unload4mod3 unload4mod4 \
255 unload6mod1 unload6mod2 unload6mod3 \
256 unload7mod1 unload7mod2 \
257 unload8mod1 unload8mod1x unload8mod2 unload8mod3 \
258 order2mod1 order2mod2 order2mod3 order2mod4 \
259 tst-unique1mod1 tst-unique1mod2 \
260 tst-unique2mod1 tst-unique2mod2 \
261 tst-auditmod9a tst-auditmod9b \
262 $(if
$(CXX
),tst-unique3lib tst-unique3lib2 tst-unique4lib \
263 tst-nodelete-uniquemod tst-nodelete-rtldmod \
265 tst-initordera1 tst-initorderb1 \
266 tst-initordera2 tst-initorderb2 \
267 tst-initordera3 tst-initordera4 \
268 tst-initorder2a tst-initorder2b tst-initorder2c \
270 tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
271 tst-array5dep tst-null-argv-lib \
272 tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod \
273 tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \
274 tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \
275 tst-latepthreadmod
$(tst-tls-many-dynamic-modules
) \
276 tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \
277 tst-main1mod tst-libc_dlvsym-dso tst-absolute-sym-lib \
278 tst-absolute-zero-lib tst-big-note-lib tst-unwind-ctor-lib
279 # Most modules build with _ISOMAC defined, but those filtered out
280 # depend on internal headers.
281 modules-names-tests
= $(filter-out ifuncmod
% tst-libc_dlvsym-dso tst-tlsmod
%,\
284 ifeq (yes
,$(have-mtls-dialect-gnu2
))
285 tests
+= tst-gnu2-tls1
286 modules-names
+= tst-gnu2-tls1mod
287 $(objpfx
)tst-gnu2-tls1
: $(objpfx
)tst-gnu2-tls1mod.so
288 tst-gnu2-tls1mod.so-no-z-defs
= yes
289 CFLAGS-tst-gnu2-tls1mod.c
+= -mtls-dialect
=gnu2
291 ifeq (yes
,$(have-protected-data
))
292 modules-names
+= tst-protected1moda tst-protected1modb
293 tests
+= tst-protected1a tst-protected1b
294 $(objpfx
)tst-protected1a
: $(addprefix $(objpfx
),tst-protected1moda.so tst-protected1modb.so
)
295 $(objpfx
)tst-protected1b
: $(addprefix $(objpfx
),tst-protected1modb.so tst-protected1moda.so
)
296 tst-protected1modb.so-no-z-defs
= yes
297 # These tests fail with GCC versions prior to 5.1 and with some versions
298 # of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709
299 # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details.
300 # Perhaps in future we can make these XFAILs conditional on some detection
301 # of compiler/linker behavior/version.
302 test-xfail-tst-protected1a
= yes
303 test-xfail-tst-protected1b
= yes
305 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
306 modules-names
+= tst-piemod1
307 tests
+= tst-pie1 tst-pie2
308 tests-pie
+= tst-pie1 tst-pie2
309 ifeq (yes
,$(have-protected-data
))
312 CFLAGS-vismain.c
+= $(PIE-ccflag
)
315 modules-execstack-yes
= tst-execstack-mod
316 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
318 # filtmod1.so has a special rule
319 modules-names-nobuild
:= filtmod1
321 tests
+= $(tests-static
)
323 ifneq (no
,$(multi-arch
))
324 tests-ifuncstatic
:= ifuncmain1static ifuncmain1picstatic \
325 ifuncmain2static ifuncmain2picstatic \
326 ifuncmain4static ifuncmain4picstatic \
327 ifuncmain5static ifuncmain5picstatic \
328 ifuncmain7static ifuncmain7picstatic
329 tests-static
+= $(tests-ifuncstatic
)
330 tests-internal
+= $(tests-ifuncstatic
)
331 ifeq (yes
,$(build-shared
))
333 ifuncmain1 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \
334 ifuncmain1staticpic \
335 ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \
336 ifuncmain5 ifuncmain5pic ifuncmain5staticpic \
337 ifuncmain7 ifuncmain7pic
338 ifunc-test-modules
= ifuncdep1 ifuncdep1pic ifuncdep2 ifuncdep2pic \
339 ifuncdep5 ifuncdep5pic
340 extra-test-objs
+= $(ifunc-test-modules
:=.o
)
341 test-internal-extras
+= $(ifunc-test-modules
)
342 ifeq (yes
,$(have-fpie
))
343 ifunc-pie-tests
= ifuncmain1pie ifuncmain1vispie ifuncmain1staticpie \
344 ifuncmain5pie ifuncmain6pie ifuncmain7pie
345 ifeq (yes
,$(have-textrel_ifunc
))
346 ifunc-pie-tests
+= tst-ifunc-textrel
348 tests-internal
+= $(ifunc-pie-tests
)
349 tests-pie
+= $(ifunc-pie-tests
)
351 modules-names
+= ifuncmod1 ifuncmod3 ifuncmod5 ifuncmod6
355 ifeq (yes
,$(build-shared
))
356 ifeq ($(run-built-tests
),yes
)
357 tests-special
+= $(objpfx
)tst-pathopt.out
$(objpfx
)tst-rtld-load-self.out
359 tests-special
+= $(objpfx
)check-textrel.out
$(objpfx
)check-execstack.out \
360 $(objpfx
)check-localplt.out
$(objpfx
)check-initfini.out
363 ifeq ($(run-built-tests
),yes
)
364 tests-special
+= $(objpfx
)order-cmp.out
$(objpfx
)tst-array1-cmp.out \
365 $(objpfx
)tst-array1-static-cmp.out \
366 $(objpfx
)tst-array2-cmp.out
$(objpfx
)tst-array3-cmp.out \
367 $(objpfx
)tst-array4-cmp.out
$(objpfx
)tst-array5-cmp.out \
368 $(objpfx
)tst-array5-static-cmp.out
$(objpfx
)order2-cmp.out \
369 $(objpfx
)tst-initorder-cmp.out \
370 $(objpfx
)tst-initorder2-cmp.out
$(objpfx
)tst-unused-dep.out \
371 $(objpfx
)tst-unused-dep-cmp.out
374 check-abi
: $(objpfx
)check-abi-ld.out
375 tests-special
+= $(objpfx
)check-abi-ld.out
376 update-abi
: update-abi-ld
377 update-all-abi
: update-all-abi-ld
379 ifeq ($(have-glob-dat-reloc
),yes
)
381 # Don't compile tst-prelink.c with PIE for GLOB_DAT relocation.
382 CFLAGS-tst-prelink.c
+= -fno-pie
383 tst-prelink-no-pie
= yes
384 ifeq ($(run-built-tests
),yes
)
385 tests-special
+= $(objpfx
)tst-prelink-cmp.out
389 # The test requires shared _and_ PIE because the executable
390 # unit test driver must be able to link with the shared object
391 # that is going to eventually go into an installed DSO.
392 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
393 tests-internal
+= tst-_dl_addr_inside_object
394 tests-pie
+= tst-_dl_addr_inside_object
395 $(objpfx
)tst-_dl_addr_inside_object
: $(objpfx
)dl-addr-obj.os
396 CFLAGS-tst-_dl_addr_inside_object.c
+= $(PIE-ccflag
)
399 # We can only test static libcrypt use if libcrypt has been built,
400 # and either NSS crypto is not in use, or static NSS libraries are
402 ifeq ($(build-crypt
),no
)
403 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=0
405 ifeq ($(nss-crypt
),no
)
406 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=1
408 ifeq ($(static-nss-crypt
),no
)
409 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=0
411 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=1
418 ifeq (yes
,$(build-shared
))
419 # Make sure these things are built in the `make lib' pass so they can be used
420 # to run programs during the `make others' pass.
421 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
422 $(addprefix $(objpfx
),$(extra-objs
))
425 # Command to link into a larger single relocatable object.
426 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
428 $(objpfx
)sotruss-lib.so
: $(shlib-lds
)
430 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
431 $(reloc-link
) -o
$@
$^
433 # Link together the dynamic linker into a single relocatable object.
434 # First we do a link against libc_pic.a just to get a link map,
435 # and discard the object produced by that link. From the link map
436 # we can glean all the libc modules that need to go into the dynamic
437 # linker. Then we do a recursive make that goes into all the subdirs
438 # those modules come from and builds special rtld-foo.os versions that
439 # are compiled with special flags, and puts these modules into rtld-libc.a
440 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
442 # If the compiler can do SSP, build the mapfile with dummy __stack_chk_fail
443 # and __stack_chk_fail_local symbols defined, to prevent the real things
444 # being dragged into rtld even though rtld is never built with stack-
447 ifeq ($(have-ssp
),yes
)
448 dummy-stack-chk-fail
:= -Wl
,--defsym
='__stack_chk_fail=0' \
449 -Wl
,--defsym
='__stack_chk_fail_local=0'
451 dummy-stack-chk-fail
:=
454 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
456 $(reloc-link
) -o
$@.o
$(dummy-stack-chk-fail
) \
457 '-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
461 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
463 sed
-n
's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
465 while read lib file
; do \
468 LC_ALL
=C fgrep
-l
/$$file \
469 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
471 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
474 echo rtld-
$${lib
%%/*} += $$file ;; \
475 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
478 echo rtld-subdirs
= `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
479 | LC_ALL=C sort -u` >> $@T
482 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
483 $(MAKE
) -f
$< -f rtld-Rules
485 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
486 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)' \
489 generated
+= librtld.map librtld.mk rtld-libc.a librtld.os.map
491 z-now-yes
= -Wl
,-z
,now
493 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
494 # Link into a temporary file so that we don't touch $@ at all
495 # if the sanity check below fails.
496 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
497 $(LDFLAGS-rtld
) -Wl
,-z
,defs
$(z-now-
$(bind-now
)) \
498 $(filter-out $(map-file
),$^
) $(load-map-file
) \
499 -Wl
,-soname
=$(rtld-installed-name
) \
501 $(call after-link
,$@.new
)
502 $(READELF
) -s
$@.new \
503 |
$(AWK
) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
506 ifeq (yes
,$(build-shared
))
507 # interp.c exists just to get the runtime linker path into libc.so.
508 $(objpfx
)interp.os
: $(common-objpfx
)runtime-linker.h
511 ifneq (ld.so
,$(rtld-installed-name
))
512 # Make sure ld.so.1 exists in the build directory so we can link
514 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
516 generated
+= $(rtld-installed-name
)
519 # Build a file mentioning all trustworthy directories to look for shared
520 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
521 # add directories to the list by defining $(user-defined-trusted-dirs)
522 # before starting make.
523 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
524 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
525 $(make-target-directory
)
526 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
527 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
528 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
529 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
531 CPPFLAGS-dl-load.c
+= -I
$(objpfx
).
-I
$(csu-objpfx
).
533 ifeq (yes
,$(build-shared
))
534 $(inst_slibdir
)/$(rtld-version-installed-name
): $(objpfx
)ld.so
$(+force)
535 $(make-target-directory
)
536 $(do-install-program
)
538 $(inst_rtlddir
)/$(rtld-installed-name
): \
539 $(inst_slibdir
)/$(rtld-version-installed-name
) \
540 $(inst_slibdir
)/libc-
$(version
).so
541 $(make-target-directory
)
544 # Special target called by parent to install just the dynamic linker.
546 ldso_install
: $(inst_rtlddir
)/$(rtld-installed-name
)
550 ldd-rewrite
= -e
's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
551 -e
's%@VERSION@%$(version)%g' \
552 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
553 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
554 -e
's%@BASH@%$(BASH)%g' \
555 -e
's%@TEXTDOMAINDIR@%$(localedir)%g'
557 ifeq ($(ldd-rewrite-script
),no
)
559 LC_ALL
=C sed
$(ldd-rewrite
) < $< > $@.new
563 LC_ALL
=C sed
$(ldd-rewrite
) < $< \
564 | LC_ALL
=C sed
-f
$(patsubst $(..
)/%,/%,$(..
)$(ldd-rewrite-script
)) > $@.new
568 $(objpfx
)ldd
: ldd.bash.in
$(common-objpfx
)soversions.mk \
569 $(common-objpfx
)config.make
574 $(objpfx
)sprof
: $(libdl
)
576 $(objpfx
)sln
: $(sln-modules
:%=$(objpfx
)%.o
)
578 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
580 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
581 CFLAGS-ldconfig.c
+= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' \
582 -D
'SLIBDIR="$(slibdir)"'
583 libof-ldconfig
= ldconfig
584 CFLAGS-dl-cache.c
+= $(SYSCONF-FLAGS
)
585 CFLAGS-cache.c
+= $(SYSCONF-FLAGS
)
586 CFLAGS-rtld.c
+= $(SYSCONF-FLAGS
)
588 cpp-srcs-left
:= $(all-rtld-routines
:=.os
)
590 include $(patsubst %,$(..
)libof-iterator.mk
,$(cpp-srcs-left
))
592 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
593 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
595 $(objpfx
)testobj1.so
: $(libdl
)
596 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
$(libdl
)
597 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
$(libdl
)
598 $(objpfx
)testobj3.so
: $(libdl
)
599 $(objpfx
)testobj4.so
: $(libdl
)
600 $(objpfx
)testobj5.so
: $(libdl
)
601 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
$(libdl
)
602 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
603 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
604 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
605 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
606 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
607 $(objpfx
)nextmod1.so
: $(libdl
)
608 $(objpfx
)neededobj1.so
: $(libdl
)
609 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
$(libdl
)
610 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
$(libdl
)
611 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
612 $(objpfx
)neededobj3.so
$(libdl
)
613 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
614 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
615 $(objpfx
)ltglobmod2.so
: $(libdl
)
616 $(objpfx
)firstobj.so
: $(shared-thread-library
)
617 $(objpfx
)globalmod1.so
: $(libdl
)
618 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
619 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
620 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
621 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
622 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
623 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
624 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
625 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
626 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
627 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
628 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
629 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
630 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
631 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
632 $(objpfx
)tst-tlsmod13a.so
: $(objpfx
)tst-tlsmod13.so
633 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
634 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
635 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
636 $(objpfx
)tst-tls19mod1.so
: $(objpfx
)tst-tls19mod2.so
$(objpfx
)tst-tls19mod3.so
637 $(objpfx
)tst-tls19mod3.so
: $(objpfx
)ld.so
638 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
639 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
640 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
641 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
642 $(objpfx
)unload3mod1.so
: $(objpfx
)unload3mod3.so
643 $(objpfx
)unload3mod2.so
: $(objpfx
)unload3mod3.so
644 $(objpfx
)unload3mod3.so
: $(objpfx
)unload3mod4.so
645 $(objpfx
)unload4mod1.so
: $(objpfx
)unload4mod2.so
$(objpfx
)unload4mod3.so
646 $(objpfx
)unload4mod2.so
: $(objpfx
)unload4mod4.so
$(objpfx
)unload4mod3.so
647 $(objpfx
)unload6mod1.so
: $(libdl
)
648 $(objpfx
)unload6mod2.so
: $(libdl
)
649 $(objpfx
)unload6mod3.so
: $(libdl
)
650 $(objpfx
)unload7mod1.so
: $(libdl
)
651 $(objpfx
)unload7mod2.so
: $(objpfx
)unload7mod1.so
652 $(objpfx
)unload8mod1.so
: $(objpfx
)unload8mod2.so
653 $(objpfx
)unload8mod2.so
: $(objpfx
)unload8mod3.so
654 $(objpfx
)unload8mod3.so
: $(libdl
)
655 $(objpfx
)tst-initordera2.so
: $(objpfx
)tst-initordera1.so
656 $(objpfx
)tst-initorderb2.so
: $(objpfx
)tst-initorderb1.so
$(objpfx
)tst-initordera2.so
657 $(objpfx
)tst-initordera3.so
: $(objpfx
)tst-initorderb2.so
$(objpfx
)tst-initorderb1.so
658 $(objpfx
)tst-initordera4.so
: $(objpfx
)tst-initordera3.so
659 $(objpfx
)tst-initorder
: $(objpfx
)tst-initordera4.so
$(objpfx
)tst-initordera1.so
$(objpfx
)tst-initorderb2.so
660 $(objpfx
)tst-null-argv
: $(objpfx
)tst-null-argv-lib.so
661 $(objpfx
)tst-tlsalign
: $(objpfx
)tst-tlsalign-lib.so
662 $(objpfx
)tst-nodelete-opened.out
: $(objpfx
)tst-nodelete-opened-lib.so
663 $(objpfx
)tst-nodelete-opened
: $(libdl
)
664 $(objpfx
)tst-noload
: $(libdl
)
666 $(objpfx
)tst-tlsalign-extern
: $(objpfx
)tst-tlsalign-vars.o
667 $(objpfx
)tst-tlsalign-extern-static
: $(objpfx
)tst-tlsalign-vars.o
669 tst-null-argv-ENV
= LD_DEBUG
=all LD_DEBUG_OUTPUT
=$(objpfx
)tst-null-argv.debug.out
670 LDFLAGS-nodel2mod3.so
= $(no-as-needed
)
671 LDFLAGS-reldepmod5.so
= $(no-as-needed
)
672 LDFLAGS-reldep6mod1.so
= $(no-as-needed
)
673 LDFLAGS-reldep6mod4.so
= $(no-as-needed
)
674 LDFLAGS-reldep8mod3.so
= $(no-as-needed
)
675 LDFLAGS-unload4mod1.so
= $(no-as-needed
)
676 LDFLAGS-unload4mod2.so
= $(no-as-needed
)
677 LDFLAGS-tst-initorder
= $(no-as-needed
)
678 LDFLAGS-tst-initordera2.so
= $(no-as-needed
)
679 LDFLAGS-tst-initordera3.so
= $(no-as-needed
)
680 LDFLAGS-tst-initordera4.so
= $(no-as-needed
)
681 LDFLAGS-tst-initorderb2.so
= $(no-as-needed
)
682 LDFLAGS-tst-tlsmod5.so
= -nostdlib
$(no-as-needed
)
683 LDFLAGS-tst-tlsmod6.so
= -nostdlib
$(no-as-needed
)
685 testobj1.so-no-z-defs
= yes
686 testobj3.so-no-z-defs
= yes
687 testobj4.so-no-z-defs
= yes
688 testobj5.so-no-z-defs
= yes
689 testobj6.so-no-z-defs
= yes
690 failobj.so-no-z-defs
= yes
691 constload2.so-no-z-defs
= yes
692 constload3.so-no-z-defs
= yes
693 nodelmod1.so-no-z-defs
= yes
694 nodelmod2.so-no-z-defs
= yes
695 nodelmod4.so-no-z-defs
= yes
696 nodel2mod2.so-no-z-defs
= yes
697 reldepmod2.so-no-z-defs
= yes
698 reldepmod3.so-no-z-defs
= yes
699 reldepmod4.so-no-z-defs
= yes
700 reldep4mod4.so-no-z-defs
= yes
701 reldep4mod2.so-no-z-defs
= yes
702 ltglobmod2.so-no-z-defs
= yes
703 dblloadmod3.so-no-z-defs
= yes
704 tst-tlsmod1.so-no-z-defs
= yes
705 tst-tlsmod2.so-no-z-defs
= yes
706 tst-tlsmod3.so-no-z-defs
= yes
707 tst-tlsmod4.so-no-z-defs
= yes
708 tst-tlsmod7.so-no-z-defs
= yes
709 tst-tlsmod8.so-no-z-defs
= yes
710 tst-tlsmod9.so-no-z-defs
= yes
711 tst-tlsmod10.so-no-z-defs
= yes
712 tst-tlsmod12.so-no-z-defs
= yes
713 tst-tlsmod14a.so-no-z-defs
= yes
714 tst-tlsmod14b.so-no-z-defs
= yes
715 tst-tlsmod15a.so-no-z-defs
= yes
716 tst-tlsmod16b.so-no-z-defs
= yes
717 circlemod2.so-no-z-defs
= yes
718 circlemod3.so-no-z-defs
= yes
719 circlemod3a.so-no-z-defs
= yes
720 reldep8mod2.so-no-z-defs
= yes
721 reldep9mod1.so-no-z-defs
= yes
722 unload3mod4.so-no-z-defs
= yes
723 unload4mod1.so-no-z-defs
= yes
724 ifuncmod1.so-no-z-defs
= yes
725 ifuncmod5.so-no-z-defs
= yes
726 ifuncmod6.so-no-z-defs
= yes
727 tst-auditmod9a.so-no-z-defs
= yes
728 tst-auditmod9b.so-no-z-defs
= yes
729 tst-nodelete-uniquemod.so-no-z-defs
= yes
730 tst-nodelete-rtldmod.so-no-z-defs
= yes
731 tst-nodelete-zmod.so-no-z-defs
= yes
732 tst-nodelete2mod.so-no-z-defs
= yes
734 ifeq ($(build-shared
),yes
)
735 # Build all the modules even when not actually running test programs.
736 tests
: $(test-modules
)
739 $(objpfx
)loadtest
: $(libdl
)
740 LDFLAGS-loadtest
= -rdynamic
742 $(objpfx
)loadtest.out
: $(test-modules
)
744 $(objpfx
)neededtest
: $(libdl
)
745 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
746 $(objpfx
)neededobj3.so
748 $(objpfx
)neededtest2
: $(libdl
)
749 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
750 $(objpfx
)neededobj3.so
752 $(objpfx
)neededtest3
: $(libdl
)
753 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
754 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
756 $(objpfx
)neededtest4
: $(libdl
) $(objpfx
)neededobj1.so
757 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
759 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
$(libdl
)
760 LDFLAGS-restest1
= -rdynamic
762 $(objpfx
)restest2
: $(libdl
)
763 LDFLAGS-restest2
= -rdynamic
765 $(objpfx
)restest1.out
: $(test-modules
)
767 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
768 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
769 LDFLAGS-preloadtest
= -rdynamic
770 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
772 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
774 $(objpfx
)loadfail
: $(libdl
)
775 LDFLAGS-loadfail
= -rdynamic
777 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
779 $(objpfx
)multiload
: $(libdl
)
780 LDFLAGS-multiload
= -rdynamic
781 CFLAGS-multiload.c
+= -DOBJDIR
=\"$(elf-objpfx
)\"
783 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
785 $(objpfx
)origtest
: $(libdl
)
786 LDFLAGS-origtest
= -rdynamic
787 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
789 ifeq ($(have-thread-library
),yes
)
790 $(objpfx
)resolvfail
: $(libdl
) $(shared-thread-library
)
792 $(objpfx
)resolvfail
: $(libdl
)
795 $(objpfx
)constload1
: $(libdl
)
796 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
798 $(objpfx
)circleload1
: $(libdl
)
799 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
800 $(objpfx
)circlemod1a.so
802 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
803 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
804 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
805 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
807 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
809 $(objpfx
)order-cmp.out
: $(objpfx
)order.out
810 (echo
"0123456789" | cmp
$< -) > $@
; \
813 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
814 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
815 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
817 $(objpfx
)noload
: $(objpfx
)testobj1.so
$(libdl
)
818 LDFLAGS-noload
= -rdynamic
$(no-as-needed
)
819 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
821 $(objpfx
)noload-mem.out
: $(objpfx
)noload.out
822 $(common-objpfx
)malloc
/mtrace
$(objpfx
)noload.mtrace
> $@
; \
824 noload-ENV
= MALLOC_TRACE
=$(objpfx
)noload.mtrace
826 LDFLAGS-nodelete
= -rdynamic
827 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
828 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
829 $(objpfx
)nodelete
: $(libdl
)
830 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
831 $(objpfx
)nodelmod3.so
833 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
834 $(objpfx
)nodlopen
: $(libdl
)
835 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
837 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
838 $(objpfx
)nodlopen2
: $(libdl
)
839 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
841 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
842 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
843 -L
$(subst :, -L
,$(rpath-link
)) \
844 -Wl
,-rpath-link
=$(rpath-link
) \
845 $< -Wl
,-F
,$(objpfx
)filtmod2.so
846 $(objpfx
)filter: $(objpfx
)filtmod1.so
848 # This does not link against libc.
849 CFLAGS-filtmod1.c
+= $(no-stack-protector
)
851 $(objpfx
)unload
: $(libdl
)
852 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
854 $(objpfx
)reldep
: $(libdl
)
855 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
857 $(objpfx
)reldep2
: $(libdl
)
858 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
860 $(objpfx
)reldep3
: $(libdl
)
861 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
863 $(objpfx
)reldep4
: $(libdl
)
864 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
866 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
$(libdl
)
867 LDFLAGS-next
= $(no-as-needed
)
869 $(objpfx
)unload2
: $(libdl
)
870 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
872 $(objpfx
)lateglobal
: $(libdl
)
873 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
875 $(objpfx
)tst-pathopt
: $(libdl
)
876 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
877 $(objpfx
)pathoptobj.so
878 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
879 '$(run-program-env)' > $@
; \
882 $(objpfx
)tst-rtld-load-self.out
: tst-rtld-load-self.sh
$(objpfx
)ld.so
883 $(SHELL
) $^
'$(test-wrapper)' '$(test-wrapper-env)' > $@
; \
886 $(objpfx
)initfirst
: $(libdl
)
887 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
889 $(objpfx
)global
: $(objpfx
)globalmod1.so
890 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
892 $(objpfx
)dblload
: $(libdl
)
893 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
895 $(objpfx
)dblunload
: $(libdl
)
896 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
898 $(objpfx
)reldep5
: $(libdl
)
899 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod6.so
901 $(objpfx
)reldep6
: $(libdl
)
902 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
904 $(objpfx
)reldep7
: $(libdl
)
905 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
907 $(objpfx
)reldep8
: $(libdl
)
908 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
910 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
911 $(objpfx
)nodelete2
: $(libdl
)
912 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
914 $(objpfx
)reldep9
: $(libdl
)
915 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
917 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
919 $(objpfx
)tst-tls4
: $(libdl
)
920 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
922 $(objpfx
)tst-tls5
: $(libdl
)
923 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
925 $(objpfx
)tst-tls6
: $(libdl
)
926 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
928 $(objpfx
)tst-tls7
: $(libdl
)
929 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
931 $(objpfx
)tst-tls8
: $(libdl
)
932 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
934 $(objpfx
)tst-tls9
: $(libdl
)
935 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
937 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
$(objpfx
)tst-tlsmod7.so
939 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
$(objpfx
)tst-tlsmod9.so
941 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
$(objpfx
)tst-tlsmod11.so
943 $(objpfx
)tst-tls13
: $(libdl
)
944 $(objpfx
)tst-tls13.out
: $(objpfx
)tst-tlsmod13a.so
946 $(objpfx
)tst-tls14
: $(objpfx
)tst-tlsmod14a.so
$(libdl
)
947 $(objpfx
)tst-tls14.out
: $(objpfx
)tst-tlsmod14b.so
949 $(objpfx
)tst-tls15
: $(libdl
)
950 $(objpfx
)tst-tls15.out
: $(objpfx
)tst-tlsmod15a.so
$(objpfx
)tst-tlsmod15b.so
952 $(objpfx
)tst-tls-dlinfo
: $(libdl
)
953 $(objpfx
)tst-tls-dlinfo.out
: $(objpfx
)tst-tlsmod2.so
957 $(objpfx
)tst-tls16
: $(libdl
)
958 $(objpfx
)tst-tls16.out
: $(objpfx
)tst-tlsmod16a.so
$(objpfx
)tst-tlsmod16b.so
960 $(objpfx
)tst-tls17
: $(libdl
)
961 $(objpfx
)tst-tls17.out
: $(objpfx
)tst-tlsmod17b.so
962 $(patsubst %,$(objpfx
)%.os
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.os
: tst-tlsmod17a.c
963 $(compile-command.c
) -DN
=$*
964 $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.so
: $(objpfx
)ld.so
965 $(objpfx
)tst-tlsmod17b.so
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
))
967 $(objpfx
)tst-tls18
: $(libdl
)
968 $(objpfx
)tst-tls18.out
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
))
969 $(patsubst %,$(objpfx
)%.os
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.os
: tst-tlsmod18a.c
970 $(compile-command.c
) -DN
=$*
971 $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.so
: $(objpfx
)ld.so
973 $(objpfx
)tst-tls19
: $(libdl
)
974 $(objpfx
)tst-tls19.out
: $(objpfx
)tst-tls19mod1.so
976 CFLAGS-tst-align.c
+= $(stack-align-test-flags
)
977 CFLAGS-tst-align2.c
+= $(stack-align-test-flags
)
978 CFLAGS-tst-alignmod.c
+= $(stack-align-test-flags
)
979 CFLAGS-tst-alignmod2.c
+= $(stack-align-test-flags
)
980 $(objpfx
)tst-align
: $(libdl
)
981 $(objpfx
)tst-align.out
: $(objpfx
)tst-alignmod.so
982 $(objpfx
)tst-align2
: $(objpfx
)tst-alignmod2.so
984 $(objpfx
)unload3
: $(libdl
)
985 $(objpfx
)unload3.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
986 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
988 $(objpfx
)unload4
: $(libdl
)
989 $(objpfx
)unload4.out
: $(objpfx
)unload4mod1.so
$(objpfx
)unload4mod3.so
991 $(objpfx
)unload5
: $(libdl
)
992 $(objpfx
)unload5.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
993 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
995 $(objpfx
)unload6
: $(libdl
)
996 $(objpfx
)unload6.out
: $(objpfx
)unload6mod1.so
$(objpfx
)unload6mod2.so \
997 $(objpfx
)unload6mod3.so
999 $(objpfx
)unload7
: $(libdl
)
1000 $(objpfx
)unload7.out
: $(objpfx
)unload7mod1.so
$(objpfx
)unload7mod2.so
1001 unload7-ENV
= MALLOC_PERTURB_
=85
1003 $(objpfx
)unload8
: $(libdl
)
1004 $(objpfx
)unload8.out
: $(objpfx
)unload8mod1.so
$(objpfx
)unload8mod1x.so
1007 $(objpfx
)tst-tls9-static
: $(common-objpfx
)dlfcn
/libdl.a
1008 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1011 ifeq ($(have-z-execstack
),yes
)
1012 $(objpfx
)tst-execstack
: $(libdl
)
1013 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
1014 CPPFLAGS-tst-execstack.c
+= -DUSE_PTHREADS
=0
1015 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
1016 LDFLAGS-tst-execstack-mod.so
= -Wl
,-z
,execstack
1018 $(objpfx
)tst-execstack-needed
: $(objpfx
)tst-execstack-mod.so
1019 LDFLAGS-tst-execstack-needed
= -Wl
,-z
,noexecstack
1021 LDFLAGS-tst-execstack-prog
= -Wl
,-z
,execstack
1022 CFLAGS-tst-execstack-prog.c
+= -Wno-trampolines
1023 CFLAGS-tst-execstack-mod.c
+= -Wno-trampolines
1026 LDFLAGS-tst-array2
= $(no-as-needed
)
1027 LDFLAGS-tst-array5
= $(no-as-needed
)
1029 $(objpfx
)tst-array1-cmp.out
: tst-array1.exp
$(objpfx
)tst-array1.out
1033 $(objpfx
)tst-array1-static-cmp.out
: tst-array1.exp \
1034 $(objpfx
)tst-array1-static.out
1038 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
1039 $(objpfx
)tst-array2-cmp.out
: tst-array2.exp
$(objpfx
)tst-array2.out
1043 $(objpfx
)tst-array3-cmp.out
: tst-array1.exp
$(objpfx
)tst-array3.out
1047 $(objpfx
)tst-array4
: $(libdl
)
1048 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array2dep.so
1049 $(objpfx
)tst-array4-cmp.out
: tst-array4.exp
$(objpfx
)tst-array4.out
1053 $(objpfx
)tst-array5
: $(objpfx
)tst-array5dep.so
1054 $(objpfx
)tst-array5-cmp.out
: tst-array5.exp
$(objpfx
)tst-array5.out
1058 $(objpfx
)tst-array5-static-cmp.out
: tst-array5-static.exp \
1059 $(objpfx
)tst-array5-static.out
1063 CFLAGS-tst-pie1.c
+= $(pie-ccflag
)
1064 CFLAGS-tst-pie2.c
+= $(pie-ccflag
)
1066 $(objpfx
)tst-piemod1.so
: $(libsupport
)
1067 $(objpfx
)tst-pie1
: $(objpfx
)tst-piemod1.so
1069 ifeq (yes
,$(build-shared
))
1070 # NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with
1071 # all-built-dso here.
1072 all-built-dso
:= $(common-objpfx
)elf
/ld.so
$(common-objpfx
)libc.so \
1073 $(filter-out $(common-objpfx
)linkobj
/libc.so
, \
1074 $(sort $(wildcard $(addprefix $(common-objpfx
), \
1078 $(all-built-dso
:=.dyn
): %.dyn
: %
1080 LC_ALL
=C
$(READELF
) -W
-d
$< > $@T
1083 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dyn
)
1085 $(objpfx
)check-textrel.out
: $(..
)scripts
/check-textrel.awk \
1086 $(all-built-dso
:=.dyn
)
1087 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1089 generated
+= check-textrel.out
1091 $(objpfx
)execstack-default
: $(first-word
$(wildcard $(sysdirs
:%=%/stackinfo.h
)))
1092 $(make-target-directory
)
1093 { echo
'#include <elf.h>'; \
1094 echo
'#include <stackinfo.h>'; \
1095 echo
'#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
1096 echo
'@@@execstack-no@@@'; \
1098 echo
'@@@execstack-yes@@@'; \
1099 echo
'#endif'; } | \
1100 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -E
-x c-header
- | \
1101 sed
-n
-e
's/^@@@\(.*\)@@@/\1/p' > $@T
1103 generated
+= execstack-default
1105 $(all-built-dso
:=.phdr
): %.phdr
: %
1107 LC_ALL
=C
$(READELF
) -W
-l
$< > $@T
1110 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.phdr
)
1112 $(objpfx
)check-execstack.out
: $(..
)scripts
/check-execstack.awk \
1113 $(objpfx
)execstack-default \
1114 $(all-built-dso
:=.phdr
)
1115 LC_ALL
=C
$(AWK
) -v
"xfail=$(check-execstack-xfail)" -f
$^
> $@
; \
1117 generated
+= check-execstack.out
1119 $(objpfx
)tst-dlmodcount
: $(libdl
)
1120 $(objpfx
)tst-dlmodcount.out
: $(test-modules
)
1122 $(all-built-dso
:=.jmprel
): %.jmprel
: % Makefile
1124 LC_ALL
=C
$(READELF
) -W
-S
-d
-r
$< > $@T
1127 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.jmprel
)
1129 localplt-built-dso
:= $(addprefix $(common-objpfx
),\
1135 resolv
/libresolv.so \
1137 ifeq ($(build-mathvec
),yes
)
1138 localplt-built-dso
+= $(addprefix $(common-objpfx
), mathvec
/libmvec.so
)
1140 ifeq ($(have-thread-library
),yes
)
1141 localplt-built-dso
+= $(filter-out %_nonshared.a
, $(shared-thread-library
))
1143 ifeq ($(build-crypt
),yes
)
1144 localplt-built-dso
+= $(addprefix $(common-objpfx
), crypt
/libcrypt.so
)
1147 vpath localplt.data
$(+sysdep_dirs
)
1149 $(objpfx
)check-localplt.out
: $(..
)scripts
/check-localplt.awk \
1150 $(..
)scripts
/localplt.awk \
1151 $(localplt-built-dso
:=.jmprel
) \
1153 LC_ALL
=C
$(AWK
) -f
$(filter-out $< %localplt.data
,$^
) | \
1154 LC_ALL
=C
$(AWK
) -f
$< $(filter %localplt.data
,$^
) - \
1159 $(all-built-dso
:=.dynsym
): %.dynsym
: %
1161 LC_ALL
=C
$(READELF
) -W
--dyn-syms
$< > $@T
1164 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dynsym
)
1166 $(objpfx
)check-initfini.out
: $(..
)scripts
/check-initfini.awk \
1167 $(all-built-dso
:=.dynsym
)
1168 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1170 generated
+= check-initfini.out
1172 $(objpfx
)tst-dlopenrpathmod.so
: $(libdl
)
1173 $(objpfx
)tst-dlopenrpath
: $(objpfx
)tst-dlopenrpathmod.so
$(libdl
)
1174 CFLAGS-tst-dlopenrpath.c
+= -DPFX
=\"$(objpfx
)\"
1175 LDFLAGS-tst-dlopenrpathmod.so
+= -Wl
,-rpath
,\
$$ORIGIN/test-subdir
1176 $(objpfx
)tst-dlopenrpath.out
: $(objpfx
)firstobj.so
1178 $(objpfx
)tst-deep1mod2.so
: $(objpfx
)tst-deep1mod3.so
1179 $(objpfx
)tst-deep1
: $(libdl
) $(objpfx
)tst-deep1mod1.so
1180 $(objpfx
)tst-deep1.out
: $(objpfx
)tst-deep1mod2.so
1181 LDFLAGS-tst-deep1
+= -rdynamic
1182 tst-deep1mod3.so-no-z-defs
= yes
1184 $(objpfx
)tst-dlmopen1mod.so
: $(libdl
)
1185 $(objpfx
)tst-dlmopen1
: $(libdl
)
1186 $(objpfx
)tst-dlmopen1.out
: $(objpfx
)tst-dlmopen1mod.so
1188 $(objpfx
)tst-dlmopen2
: $(libdl
)
1189 $(objpfx
)tst-dlmopen2.out
: $(objpfx
)tst-dlmopen1mod.so
1191 $(objpfx
)tst-dlmopen3
: $(libdl
)
1192 $(objpfx
)tst-dlmopen3.out
: $(objpfx
)tst-dlmopen1mod.so
1194 $(objpfx
)tst-audit1.out
: $(objpfx
)tst-auditmod1.so
1195 tst-audit1-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1197 $(objpfx
)tst-audit2
: $(libdl
)
1198 $(objpfx
)tst-audit2.out
: $(objpfx
)tst-auditmod1.so
$(objpfx
)tst-auditmod9b.so
1199 # Prevent GCC-5 from translating a malloc/memset pair into calloc
1200 CFLAGS-tst-audit2.c
+= -fno-builtin
1201 tst-audit2-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1203 $(objpfx
)tst-audit9
: $(libdl
)
1204 $(objpfx
)tst-audit9.out
: $(objpfx
)tst-auditmod9a.so
$(objpfx
)tst-auditmod9b.so
1205 tst-audit9-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod9a.so
1207 $(objpfx
)tst-audit8
: $(libm
)
1208 $(objpfx
)tst-audit8.out
: $(objpfx
)tst-auditmod1.so
1209 tst-audit8-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1211 $(objpfx
)tst-global1
: $(libdl
)
1212 $(objpfx
)tst-global1.out
: $(objpfx
)testobj6.so
$(objpfx
)testobj2.so
1214 $(objpfx
)order2
: $(libdl
)
1215 $(objpfx
)order2.out
: $(objpfx
)order2mod1.so
$(objpfx
)order2mod2.so
1216 $(objpfx
)order2-cmp.out
: $(objpfx
)order2.out
1217 (echo
"12345" | cmp
$< -) > $@
; \
1219 $(objpfx
)order2mod1.so
: $(objpfx
)order2mod4.so
1220 $(objpfx
)order2mod4.so
: $(objpfx
)order2mod3.so
1221 $(objpfx
)order2mod2.so
: $(objpfx
)order2mod3.so
1222 order2mod2.so-no-z-defs
= yes
1223 LDFLAGS-order2mod1.so
= $(no-as-needed
)
1224 LDFLAGS-order2mod2.so
= $(no-as-needed
)
1226 tst-stackguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
1227 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
1229 tst-ptrguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
1230 # When built statically, the pointer guard interface uses
1231 # __pointer_chk_guard_local.
1232 CFLAGS-tst-ptrguard1-static.c
+= -DPTRGUARD_LOCAL
1233 tst-ptrguard1-static-ARGS
= --command
"$(objpfx)tst-ptrguard1-static --child"
1235 $(objpfx
)tst-leaks1
: $(libdl
)
1236 $(objpfx
)tst-leaks1-mem.out
: $(objpfx
)tst-leaks1.out
1237 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1.mtrace
> $@
; \
1240 $(objpfx
)tst-leaks1-static
: $(common-objpfx
)dlfcn
/libdl.a
1241 $(objpfx
)tst-leaks1-static-mem.out
: $(objpfx
)tst-leaks1-static.out
1242 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1-static.mtrace
> $@
; \
1245 tst-leaks1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1.mtrace
1246 tst-leaks1-static-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1-static.mtrace
1248 $(objpfx
)tst-addr1
: $(libdl
)
1250 $(objpfx
)tst-thrlock
: $(libdl
) $(shared-thread-library
)
1251 $(objpfx
)tst-dlopen-aout
: $(libdl
) $(shared-thread-library
)
1253 CFLAGS-ifuncmain1pic.c
+= $(pic-ccflag
)
1254 CFLAGS-ifuncmain1picstatic.c
+= $(pic-ccflag
)
1255 CFLAGS-ifuncmain1staticpic.c
+= $(pic-ccflag
)
1256 CFLAGS-ifuncdep1pic.c
+= $(pic-ccflag
)
1257 CFLAGS-ifuncmain1vispic.c
+= $(pic-ccflag
)
1258 CFLAGS-ifuncmain2pic.c
+= $(pic-ccflag
)
1259 CFLAGS-ifuncmain2picstatic.c
+= $(pic-ccflag
)
1260 CFLAGS-ifuncdep2pic.c
+= $(pic-ccflag
)
1261 CFLAGS-ifuncmain4picstatic.c
+= $(pic-ccflag
)
1262 CFLAGS-ifuncmain5pic.c
+= $(pic-ccflag
)
1263 CFLAGS-ifuncmain5picstatic.c
+= $(pic-ccflag
)
1264 CFLAGS-ifuncmain5staticpic.c
+= $(pic-ccflag
)
1265 CFLAGS-ifuncdep5pic.c
+= $(pic-ccflag
)
1266 CFLAGS-ifuncmain7pic.c
+= $(pic-ccflag
)
1267 CFLAGS-ifuncmain7picstatic.c
+= $(pic-ccflag
)
1269 LDFLAGS-ifuncmain3
= -Wl
,-export-dynamic
1271 CFLAGS-ifuncmain1pie.c
+= $(pie-ccflag
)
1272 CFLAGS-ifuncmain1vispie.c
+= $(pie-ccflag
)
1273 CFLAGS-ifuncmain1staticpie.c
+= $(pie-ccflag
)
1274 CFLAGS-ifuncmain5pie.c
+= $(pie-ccflag
)
1275 CFLAGS-ifuncmain6pie.c
+= $(pie-ccflag
)
1276 CFLAGS-ifuncmain7pie.c
+= $(pie-ccflag
)
1277 CFLAGS-tst-ifunc-textrel.c
+= $(pic-ccflag
)
1279 $(objpfx
)ifuncmain1pie
: $(objpfx
)ifuncmod1.so
1280 $(objpfx
)ifuncmain1staticpie
: $(objpfx
)ifuncdep1pic.o
1281 $(objpfx
)ifuncmain1vispie
: $(objpfx
)ifuncmod1.so
1282 $(objpfx
)ifuncmain5pie
: $(objpfx
)ifuncmod5.so
1283 $(objpfx
)ifuncmain6pie
: $(objpfx
)ifuncmod6.so
1285 $(objpfx
)ifuncmain1
: $(addprefix $(objpfx
),ifuncmod1.so
)
1286 $(objpfx
)ifuncmain1pic
: $(addprefix $(objpfx
),ifuncmod1.so
)
1287 $(objpfx
)ifuncmain1staticpic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
1288 $(objpfx
)ifuncmain1static
: $(addprefix $(objpfx
),ifuncdep1.o
)
1289 $(objpfx
)ifuncmain1picstatic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
1290 $(objpfx
)ifuncmain1vis
: $(addprefix $(objpfx
),ifuncmod1.so
)
1291 $(objpfx
)ifuncmain1vispic
: $(addprefix $(objpfx
),ifuncmod1.so
)
1292 $(objpfx
)ifuncmain2
: $(addprefix $(objpfx
),ifuncdep2.o
)
1293 $(objpfx
)ifuncmain2pic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
1294 $(objpfx
)ifuncmain2static
: $(addprefix $(objpfx
),ifuncdep2.o
)
1295 $(objpfx
)ifuncmain2picstatic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
1297 $(objpfx
)ifuncmain3
: $(libdl
)
1298 $(objpfx
)ifuncmain3.out
: $(objpfx
)ifuncmod3.so
1300 $(objpfx
)ifuncmain5
: $(addprefix $(objpfx
),ifuncmod5.so
)
1301 $(objpfx
)ifuncmain5pic
: $(addprefix $(objpfx
),ifuncmod5.so
)
1302 $(objpfx
)ifuncmain5static
: $(addprefix $(objpfx
),ifuncdep5.o
)
1303 $(objpfx
)ifuncmain5staticpic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
1304 $(objpfx
)ifuncmain5picstatic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
1306 $(objpfx
)tst-unique1
: $(libdl
)
1307 $(objpfx
)tst-unique1.out
: $(objpfx
)tst-unique1mod1.so \
1308 $(objpfx
)tst-unique1mod2.so
1310 $(objpfx
)tst-unique2
: $(libdl
) $(objpfx
)tst-unique2mod1.so
1311 $(objpfx
)tst-unique2.out
: $(objpfx
)tst-unique2mod2.so
1313 $(objpfx
)tst-unique3
: $(libdl
) $(objpfx
)tst-unique3lib.so
1314 $(objpfx
)tst-unique3.out
: $(objpfx
)tst-unique3lib2.so
1316 $(objpfx
)tst-unique4
: $(objpfx
)tst-unique4lib.so
1318 $(objpfx
)tst-nodelete
: $(libdl
)
1319 $(objpfx
)tst-nodelete.out
: $(objpfx
)tst-nodelete-uniquemod.so \
1320 $(objpfx
)tst-nodelete-rtldmod.so \
1321 $(objpfx
)tst-nodelete-zmod.so
1323 LDFLAGS-tst-nodelete
= -rdynamic
1324 LDFLAGS-tst-nodelete-zmod.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1326 $(objpfx
)tst-nodelete2
: $(libdl
)
1327 $(objpfx
)tst-nodelete2.out
: $(objpfx
)tst-nodelete2mod.so
1329 LDFLAGS-tst-nodelete2
= -rdynamic
1331 $(objpfx
)tst-initorder-cmp.out
: tst-initorder.exp
$(objpfx
)tst-initorder.out
1335 $(objpfx
)tst-initorder2
: $(objpfx
)tst-initorder2a.so
$(objpfx
)tst-initorder2d.so
$(objpfx
)tst-initorder2c.so
1336 $(objpfx
)tst-initorder2a.so
: $(objpfx
)tst-initorder2b.so
1337 $(objpfx
)tst-initorder2b.so
: $(objpfx
)tst-initorder2c.so
1338 $(objpfx
)tst-initorder2c.so
: $(objpfx
)tst-initorder2d.so
1339 LDFLAGS-tst-initorder2
= $(no-as-needed
)
1340 LDFLAGS-tst-initorder2a.so
= $(no-as-needed
)
1341 LDFLAGS-tst-initorder2b.so
= $(no-as-needed
)
1342 LDFLAGS-tst-initorder2c.so
= $(no-as-needed
)
1343 define o-iterator-doit
1344 $(objpfx
)tst-initorder2
$o.os
: tst-initorder2.c
; \
1345 $$(compile-command.c
) -DNAME
=\"$o\"
1347 object-suffixes-left
:= a b c d
1348 include $(o-iterator
)
1350 $(objpfx
)tst-initorder2-cmp.out
: tst-initorder2.exp
$(objpfx
)tst-initorder2.out
1354 $(objpfx
)tst-relsort1
: $(libdl
)
1355 $(objpfx
)tst-relsort1mod1.so
: $(libm
) $(objpfx
)tst-relsort1mod2.so
1356 $(objpfx
)tst-relsort1mod2.so
: $(libm
)
1357 $(objpfx
)tst-relsort1.out
: $(objpfx
)tst-relsort1mod1.so \
1358 $(objpfx
)tst-relsort1mod2.so
1360 $(objpfx
)tst-unused-dep.out
: $(objpfx
)testobj1.so
1361 $(test-wrapper-env
) \
1362 LD_TRACE_LOADED_OBJECTS
=1 \
1369 $(objpfx
)tst-unused-dep-cmp.out
: $(objpfx
)tst-unused-dep.out
1370 cmp
$< /dev
/null
> $@
; \
1373 $(objpfx
)tst-audit11.out
: $(objpfx
)tst-auditmod11.so
$(objpfx
)tst-audit11mod1.so
1374 $(objpfx
)tst-audit11
: $(libdl
)
1375 tst-audit11-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod11.so
1376 $(objpfx
)tst-audit11mod1.so
: $(objpfx
)tst-audit11mod2.so
1377 LDFLAGS-tst-audit11mod2.so
= -Wl
,--version-script
=tst-audit11mod2.map
,-soname
,tst-audit11mod2.so
1379 $(objpfx
)tst-audit12.out
: $(objpfx
)tst-auditmod12.so
$(objpfx
)tst-audit12mod1.so
$(objpfx
)tst-audit12mod3.so
1380 $(objpfx
)tst-audit12
: $(libdl
)
1381 tst-audit12-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod12.so
1382 $(objpfx
)tst-audit12mod1.so
: $(objpfx
)tst-audit12mod2.so
1383 LDFLAGS-tst-audit12mod2.so
= -Wl
,--version-script
=tst-audit12mod2.map
1385 # Override -z defs, so that we can reference an undefined symbol.
1386 # Force lazy binding for the same reason.
1387 LDFLAGS-tst-latepthreadmod.so
= \
1388 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
1389 # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
1390 # function this_function_is_not_defined.
1391 CFLAGS-tst-latepthreadmod.c
+= -fno-optimize-sibling-calls
1392 $(objpfx
)tst-latepthreadmod.so
: $(shared-thread-library
)
1393 $(objpfx
)tst-latepthread
: $(libdl
)
1394 $(objpfx
)tst-latepthread.out
: $(objpfx
)tst-latepthreadmod.so
1396 # The test modules are parameterized by preprocessor macros.
1397 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules
)): \
1398 $(objpfx
)tst-tls-manydynamic
%mod.os
: tst-tls-manydynamicmod.c
1399 $(compile-command.c
) \
1400 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
1401 $(objpfx
)tst-tls-manydynamic
: $(libdl
) $(shared-thread-library
)
1402 $(objpfx
)tst-tls-manydynamic.out
: \
1403 $(patsubst %,$(objpfx
)%.so
,$(tst-tls-many-dynamic-modules
))
1405 tst-prelink-ENV
= LD_TRACE_PRELINKING
=1
1407 $(objpfx
)tst-prelink-conflict.out
: $(objpfx
)tst-prelink.out
1408 grep stdout
$< | grep conflict |
$(AWK
) '{ print $$10, $$11 }' > $@
1410 $(objpfx
)tst-prelink-cmp.out
: tst-prelink.exp \
1411 $(objpfx
)tst-prelink-conflict.out
1415 $(objpfx
)tst-ldconfig-X.out
: tst-ldconfig-X.sh
$(objpfx
)ldconfig
1416 $(SHELL
) $< '$(common-objpfx)' '$(test-wrapper-env)' \
1417 '$(run-program-env)' > $@
; \
1420 $(objpfx
)tst-dlsym-error
: $(libdl
)
1422 # Test static linking of all the libraries we can possibly link
1423 # together. Note that in some configurations this may be less than the
1424 # complete list of libraries we build but we try to maxmimize this list.
1425 $(objpfx
)tst-linkall-static
: \
1426 $(common-objpfx
)math
/libm.a \
1427 $(common-objpfx
)resolv
/libresolv.a \
1428 $(common-objpfx
)dlfcn
/libdl.a \
1429 $(common-objpfx
)login
/libutil.a \
1430 $(common-objpfx
)rt
/librt.a \
1431 $(common-objpfx
)resolv
/libanl.a \
1432 $(static-thread-library
)
1434 ifeq ($(build-crypt
),yes
)
1435 # If we are using NSS crypto and we have the ability to link statically
1436 # then we include libcrypt.a, otherwise we leave out libcrypt.a and
1437 # link as much as we can into the tst-linkall-static test. This assumes
1438 # that linking with libcrypt.a does everything required to include the
1439 # static NSS crypto library.
1440 ifeq (yesyes
,$(nss-crypt
)$(static-nss-crypt
))
1441 $(objpfx
)tst-linkall-static
: \
1442 $(common-objpfx
)crypt
/libcrypt.a
1444 # If we are not using NSS crypto then we always have the ability to link
1446 ifeq (no
,$(nss-crypt
))
1447 $(objpfx
)tst-linkall-static
: \
1448 $(common-objpfx
)crypt
/libcrypt.a
1452 # The application depends on the DSO, and the DSO loads the plugin.
1453 # The plugin also depends on the DSO. This creates the circular
1454 # dependency via dlopen that we're testing to make sure works.
1455 $(objpfx
)tst-nodelete-dlclose-dso.so
: $(libdl
)
1456 $(objpfx
)tst-nodelete-dlclose-plugin.so
: $(objpfx
)tst-nodelete-dlclose-dso.so
1457 $(objpfx
)tst-nodelete-dlclose
: $(objpfx
)tst-nodelete-dlclose-dso.so
1458 $(objpfx
)tst-nodelete-dlclose.out
: $(objpfx
)tst-nodelete-dlclose-dso.so \
1459 $(objpfx
)tst-nodelete-dlclose-plugin.so
1461 tst-env-setuid-ENV
= MALLOC_CHECK_
=2 MALLOC_MMAP_THRESHOLD_
=4096 \
1463 tst-env-setuid-tunables-ENV
= \
1464 GLIBC_TUNABLES
=glibc.malloc.
check=2:glibc.malloc.mmap_threshold
=4096
1466 $(objpfx
)tst-debug1
: $(libdl
)
1467 $(objpfx
)tst-debug1.out
: $(objpfx
)tst-debug1mod1.so
1469 $(objpfx
)tst-debug1mod1.so
: $(objpfx
)testobj1.so
1470 $(OBJCOPY
) --only-keep-debug
$< $@
1472 $(objpfx
)tst-main1
: $(objpfx
)tst-main1mod.so
1473 CRT-tst-main1
:= $(csu-objpfx
)crt1.o
1474 tst-main1-no-pie
= yes
1475 LDLIBS-tst-main1
= $(libsupport
)
1476 tst-main1mod.so-no-z-defs
= yes
1478 LDLIBS-tst-absolute-sym-lib.so
= tst-absolute-sym-lib.lds
1479 $(objpfx
)tst-absolute-sym-lib.so
: $(LDLIBS-tst-absolute-sym-lib.so
)
1480 $(objpfx
)tst-absolute-sym
: $(objpfx
)tst-absolute-sym-lib.so
1482 LDLIBS-tst-absolute-zero-lib.so
= tst-absolute-zero-lib.lds
1483 $(objpfx
)tst-absolute-zero-lib.so
: $(LDLIBS-tst-absolute-zero-lib.so
)
1484 $(objpfx
)tst-absolute-zero
: $(objpfx
)tst-absolute-zero-lib.so
1486 # Both the main program and the DSO for tst-libc_dlvsym need to link
1488 $(objpfx
)tst-libc_dlvsym
: $(libdl
)
1489 $(objpfx
)tst-libc_dlvsym-dso.so
: $(libsupport
) $(libdl
)
1490 $(objpfx
)tst-libc_dlvsym.out
: $(objpfx
)tst-libc_dlvsym-dso.so
1491 $(objpfx
)tst-libc_dlvsym-static
: $(common-objpfx
)dlfcn
/libdl.a
1492 tst-libc_dlvsym-static-ENV
= \
1493 LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
):$(common-objpfx
)dlfcn
1494 $(objpfx
)tst-libc_dlvsym-static.out
: $(objpfx
)tst-libc_dlvsym-dso.so
1496 $(objpfx
)tst-big-note
: $(objpfx
)tst-big-note-lib.so
1498 $(objpfx
)tst-unwind-ctor
: $(objpfx
)tst-unwind-ctor-lib.so
1500 CFLAGS-tst-unwind-main.c
+= -funwind-tables