1 # Copyright (C) 1995-2020 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 # <https://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 \
28 dl-reloc-static-pie libc_early_init
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 \
36 exception sort-maps lookup-direct \
38 ifeq (yes
,$(use-ldconfig
))
39 dl-routines
+= dl-cache
42 ifneq (no
,$(have-tunables
))
43 dl-routines
+= dl-tunables
44 tunables-type
= $(addprefix TUNABLES_FRONTEND_
,$(have-tunables
))
45 CPPFLAGS-dl-tunables.c
+= -DTUNABLES_FRONTEND
=$(tunables-type
)
47 # Make sure that the compiler does not insert any library calls in tunables
49 ifeq (yes
,$(have-loop-to-function
))
50 CFLAGS-dl-tunables.c
+= -fno-tree-loop-distribute-patterns
54 all-dl-routines
= $(dl-routines
) $(sysdep-dl-routines
)
55 # But they are absent from the shared libc, because that code is in ld.so.
56 elide-routines.os
= $(all-dl-routines
) dl-support enbl-secure dl-origin \
57 dl-sysdep dl-exception dl-reloc-static-pie
59 # ld.so uses those routines, plus some special stuff for being the program
60 # interpreter and operating independent of libc.
61 rtld-routines
= rtld
$(all-dl-routines
) dl-sysdep dl-environ dl-minimal \
62 dl-error-minimal dl-conflict
63 all-rtld-routines
= $(rtld-routines
) $(sysdep-rtld-routines
)
65 CFLAGS-dl-runtime.c
+= -fexceptions
-fasynchronous-unwind-tables
66 CFLAGS-dl-lookup.c
+= -fexceptions
-fasynchronous-unwind-tables
67 CFLAGS-dl-iterate-phdr.c
+= $(uses-callbacks
)
69 # On targets without __builtin_memset, rtld.c uses a hand-coded loop
70 # in _dl_start. Make sure this isn't turned into a call to regular memset.
71 ifeq (yes
,$(have-loop-to-function
))
72 CFLAGS-rtld.c
+= -fno-tree-loop-distribute-patterns
75 # Compile rtld itself without stack protection.
76 # Also compile all routines in the static library that are elided from
77 # the shared libc because they are in libc.a in the same way.
79 define elide-stack-protector
80 $(if
$(filter $(@F
),$(patsubst %,%$(1),$(2))), $(no-stack-protector
))
83 CFLAGS-.o
+= $(call elide-stack-protector
,.o
,$(elide-routines.os
))
84 CFLAGS-.op
+= $(call elide-stack-protector
,.op
,$(elide-routines.os
))
85 CFLAGS-.os
+= $(call elide-stack-protector
,.os
,$(all-rtld-routines
))
87 ifeq ($(unwind-find-fde
),yes
)
88 routines
+= unwind-dw2-fde-glibc
89 shared-only-routines
+= unwind-dw2-fde-glibc
92 before-compile
+= $(objpfx
)trusted-dirs.h
93 generated
+= trusted-dirs.h trusted-dirs.st for-renamed
/renamed.so
94 generated-dirs
+= for-renamed
96 ifeq ($(build-shared
),yes
)
97 ld-map
= $(common-objpfx
)ld.map
100 ifeq (yes
,$(build-shared
))
101 extra-objs
= $(all-rtld-routines
:%=%.os
) soinit.os sofini.os interp.os
102 generated
+= librtld.os dl-allobjs.os
ld.so ldd
103 install-others
= $(inst_rtlddir
)/$(rtld-installed-name
)
104 install-bin-script
= ldd
110 install-rootsbin
= sln
111 sln-modules
:= static-stubs
112 extra-objs
+= $(sln-modules
:=.o
)
114 ifeq (yes
,$(use-ldconfig
))
115 ifeq (yes
,$(build-shared
))
116 others-static
+= ldconfig
118 install-rootsbin
+= ldconfig
120 ldconfig-modules
:= cache readlib xmalloc xstrdup chroot_canon static-stubs
121 extra-objs
+= $(ldconfig-modules
:=.o
)
122 others-extras
= $(ldconfig-modules
)
126 # To find xmalloc.c and xstrdup.c
127 vpath
%.c ..
/locale
/programs
129 ifeq ($(build-shared
),yes
)
130 extra-objs
+= sotruss-lib.os sotruss-lib.so
131 install-others
+= $(inst_auditdir
)/sotruss-lib.so
132 install-bin-script
+= sotruss
134 libof-sotruss-lib
= extramodules
135 LDFLAGS-sotruss-lib.so
+= $(z-now-
$(bind-now
))
136 $(objpfx
)sotruss-lib.so
: $(objpfx
)sotruss-lib.os
137 $(build-module-asneeded
)
138 $(objpfx
)sotruss-lib.so
: $(common-objpfx
)libc.so
$(objpfx
)ld.so \
139 $(common-objpfx
)libc_nonshared.a
141 $(objpfx
)sotruss
: sotruss.sh
$(common-objpfx
)config.make
142 sed
-e
's%@BASH@%$(BASH)%g' \
143 -e
's%@VERSION@%$(version)%g' \
144 -e
's%@TEXTDOMAINDIR@%$(localedir)%g' \
145 -e
's%@PREFIX@%$(prefix)%g' \
146 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
147 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
151 $(inst_auditdir
)/sotruss-lib.so
: $(objpfx
)sotruss-lib.so
$(+force)
152 $(do-install-program
)
155 tests-static-normal
:= tst-leaks1-static tst-array1-static tst-array5-static \
157 tst-tlsalign-static tst-tlsalign-extern-static \
158 tst-linkall-static tst-env-setuid tst-env-setuid-tunables
159 tests-static-internal
:= tst-tls1-static tst-tls2-static \
160 tst-ptrguard1-static tst-stackguard1-static \
161 tst-tls1-static-non-pie tst-libc_dlvsym-static
163 CRT-tst-tls1-static-non-pie
:= $(csu-objpfx
)crt1.o
164 tst-tls1-static-non-pie-no-pie
= yes
167 tst-ldconfig-bad-aux-cache \
168 tst-ldconfig-ld_so_conf-update
170 tests
:= tst-tls9 tst-leaks1 \
171 tst-array1 tst-array2 tst-array3 tst-array4 tst-array5 \
173 tests-internal
:= tst-tls1 tst-tls2
$(tests-static-internal
)
174 tests-static
:= $(tests-static-normal
) $(tests-static-internal
)
176 ifeq (yes
,$(build-shared
))
177 tests-static
+= tst-tls9-static
178 tst-tls9-static-ENV
= \
179 LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
):$(common-objpfx
)dlfcn
181 tests
+= restest1 preloadtest loadfail multiload origtest resolvfail \
182 constload1 order noload
filter \
183 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
184 nodlopen nodlopen2 lateglobal initfirst global \
185 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
187 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
188 tst-tls16 tst-tls17 tst-tls18 tst-tls19 tst-tls-dlinfo \
189 tst-align tst-align2 \
190 tst-dlmodcount tst-dlopenrpath tst-deep1 \
191 tst-dlmopen1 tst-dlmopen3 \
192 unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
193 tst-audit1 tst-audit2 tst-audit8 tst-audit9 \
194 tst-addr1 tst-thrlock \
195 tst-unique1 tst-unique2
$(if
$(CXX
),tst-unique3 tst-unique4 \
196 tst-nodelete tst-dlopen-nodelete-reloc
) \
197 tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
198 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
199 tst-nodelete2 tst-audit11 tst-audit12 tst-dlsym-error tst-noload \
200 tst-latepthread tst-tls-manydynamic tst-nodelete-dlclose \
201 tst-debug1 tst-main1 tst-absolute-sym tst-absolute-zero tst-big-note \
202 tst-unwind-ctor tst-unwind-main tst-audit13 \
203 tst-sonamemove-link tst-sonamemove-dlopen tst-dlopen-tlsmodid \
204 tst-dlopen-self tst-auditmany tst-initfinilazyfail tst-dlopenfail \
206 tst-filterobj tst-filterobj-dlopen tst-auxobj tst-auxobj-dlopen \
207 tst-audit14 tst-audit15 tst-audit16
209 tests-internal
+= loadtest unload unload2 circleload1 \
210 neededtest neededtest2 neededtest3 neededtest4 \
211 tst-tls3 tst-tls6 tst-tls7 tst-tls8 tst-dlmopen2 \
212 tst-ptrguard1 tst-stackguard1 tst-libc_dlvsym \
214 tests-container
+= tst-pldd tst-dlopen-tlsmodid-container \
215 tst-dlopen-self-container
216 test-srcs
= tst-pathopt
217 selinux-enabled
:= $(shell cat
/selinux
/enforce
2> /dev
/null
)
218 ifneq ($(selinux-enabled
),1)
219 tests-execstack-yes
= tst-execstack tst-execstack-needed tst-execstack-prog
222 tests
+= $(tests-execstack-
$(have-z-execstack
))
223 ifeq ($(run-built-tests
),yes
)
224 tests-special
+= $(objpfx
)tst-leaks1-mem.out \
225 $(objpfx
)tst-leaks1-static-mem.out
$(objpfx
)noload-mem.out \
226 $(objpfx
)tst-ldconfig-X.out
228 tlsmod17a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
229 tlsmod18a-suffixes
= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
230 tlsmod17a-modules
= $(addprefix tst-tlsmod17a
, $(tlsmod17a-suffixes
))
231 tlsmod18a-modules
= $(addprefix tst-tlsmod18a
, $(tlsmod17a-suffixes
))
232 one-hundred
= $(foreach x
,0 1 2 3 4 5 6 7 8 9, \
233 0$x 1$x 2$x 3$x 4$x 5$x 6$x 7$x 8$x 9$x)
234 tst-tls-many-dynamic-modules
:= \
235 $(foreach n
,$(one-hundred
),tst-tls-manydynamic
$(n
)mod
)
236 extra-test-objs
+= $(tlsmod17a-modules
:=.os
) $(tlsmod18a-modules
:=.os
) \
238 test-extras
+= tst-tlsmod17a tst-tlsmod18a tst-tlsalign-vars
239 modules-names
= testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
240 testobj1_1 failobj constload2 constload3 unloadmod \
241 dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
242 nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
243 nodel2mod1 nodel2mod2 nodel2mod3 \
244 nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
245 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
246 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
247 neededobj1 neededobj2 neededobj3 neededobj4 \
248 neededobj5 neededobj6 firstobj globalmod1 \
249 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \
250 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \
251 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \
252 reldep7mod1 reldep7mod2 \
253 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \
254 tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
255 tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
256 tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
257 tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
258 $(tlsmod17a-modules
) tst-tlsmod17b
$(tlsmod18a-modules
) \
259 tst-tls19mod1 tst-tls19mod2 tst-tls19mod3 \
260 circlemod1 circlemod1a circlemod2 circlemod2a \
261 circlemod3 circlemod3a \
262 reldep8mod1 reldep8mod2 reldep8mod3 \
263 reldep9mod1 reldep9mod2 reldep9mod3 \
264 tst-alignmod tst-alignmod2 \
265 $(modules-execstack-
$(have-z-execstack
)) \
266 tst-dlopenrpathmod tst-deep1mod1 tst-deep1mod2 tst-deep1mod3 \
267 tst-dlmopen1mod tst-auditmod1 \
268 unload3mod1 unload3mod2 unload3mod3 unload3mod4 \
269 unload4mod1 unload4mod2 unload4mod3 unload4mod4 \
270 unload6mod1 unload6mod2 unload6mod3 \
271 unload7mod1 unload7mod2 \
272 unload8mod1 unload8mod1x unload8mod2 unload8mod3 \
273 order2mod1 order2mod2 order2mod3 order2mod4 \
274 tst-unique1mod1 tst-unique1mod2 \
275 tst-unique2mod1 tst-unique2mod2 \
276 tst-auditmod9a tst-auditmod9b \
277 $(if
$(CXX
),tst-unique3lib tst-unique3lib2 tst-unique4lib \
278 tst-nodelete-uniquemod tst-nodelete-rtldmod \
280 tst-dlopen-nodelete-reloc-mod1 \
281 tst-dlopen-nodelete-reloc-mod2 \
282 tst-dlopen-nodelete-reloc-mod3 \
283 tst-dlopen-nodelete-reloc-mod4 \
284 tst-dlopen-nodelete-reloc-mod5 \
285 tst-dlopen-nodelete-reloc-mod6 \
286 tst-dlopen-nodelete-reloc-mod7 \
287 tst-dlopen-nodelete-reloc-mod8 \
288 tst-dlopen-nodelete-reloc-mod9 \
289 tst-dlopen-nodelete-reloc-mod10 \
290 tst-dlopen-nodelete-reloc-mod11 \
291 tst-dlopen-nodelete-reloc-mod12 \
292 tst-dlopen-nodelete-reloc-mod13 \
293 tst-dlopen-nodelete-reloc-mod14 \
294 tst-dlopen-nodelete-reloc-mod15 \
295 tst-dlopen-nodelete-reloc-mod16 \
296 tst-dlopen-nodelete-reloc-mod17
) \
297 tst-initordera1 tst-initorderb1 \
298 tst-initordera2 tst-initorderb2 \
299 tst-initordera3 tst-initordera4 \
300 tst-initorder2a tst-initorder2b tst-initorder2c \
302 tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
303 tst-array5dep tst-null-argv-lib \
304 tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod \
305 tst-audit11mod1 tst-audit11mod2 tst-auditmod11 \
306 tst-audit12mod1 tst-audit12mod2 tst-audit12mod3 tst-auditmod12 \
307 tst-latepthreadmod
$(tst-tls-many-dynamic-modules
) \
308 tst-nodelete-dlclose-dso tst-nodelete-dlclose-plugin \
309 tst-main1mod tst-libc_dlvsym-dso tst-absolute-sym-lib \
310 tst-absolute-zero-lib tst-big-note-lib tst-unwind-ctor-lib \
311 tst-audit13mod1 tst-sonamemove-linkmod1 \
312 tst-sonamemove-runmod1 tst-sonamemove-runmod2 \
313 tst-auditmanymod1 tst-auditmanymod2 tst-auditmanymod3 \
314 tst-auditmanymod4 tst-auditmanymod5 tst-auditmanymod6 \
315 tst-auditmanymod7 tst-auditmanymod8 tst-auditmanymod9 \
316 tst-initlazyfailmod tst-finilazyfailmod \
317 tst-dlopenfailmod1 tst-dlopenfaillinkmod tst-dlopenfailmod2 \
318 tst-dlopenfailmod3 tst-ldconfig-ld-mod \
319 tst-filterobj-flt tst-filterobj-aux tst-filterobj-filtee \
320 tst-auditlogmod-1 tst-auditlogmod-2 tst-auditlogmod-3
321 # Most modules build with _ISOMAC defined, but those filtered out
322 # depend on internal headers.
323 modules-names-tests
= $(filter-out ifuncmod
% tst-libc_dlvsym-dso tst-tlsmod
%,\
326 ifeq (yes
,$(have-mtls-dialect-gnu2
))
327 tests
+= tst-gnu2-tls1
328 modules-names
+= tst-gnu2-tls1mod
329 $(objpfx
)tst-gnu2-tls1
: $(objpfx
)tst-gnu2-tls1mod.so
330 tst-gnu2-tls1mod.so-no-z-defs
= yes
331 CFLAGS-tst-gnu2-tls1mod.c
+= -mtls-dialect
=gnu2
333 ifeq (yes
,$(have-protected-data
))
334 modules-names
+= tst-protected1moda tst-protected1modb
335 tests
+= tst-protected1a tst-protected1b
336 $(objpfx
)tst-protected1a
: $(addprefix $(objpfx
),tst-protected1moda.so tst-protected1modb.so
)
337 $(objpfx
)tst-protected1b
: $(addprefix $(objpfx
),tst-protected1modb.so tst-protected1moda.so
)
338 tst-protected1modb.so-no-z-defs
= yes
339 # These tests fail with GCC versions prior to 5.1 and with some versions
340 # of binutils. See https://sourceware.org/bugzilla/show_bug.cgi?id=17709
341 # and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 for details.
342 # Perhaps in future we can make these XFAILs conditional on some detection
343 # of compiler/linker behavior/version.
344 test-xfail-tst-protected1a
= yes
345 test-xfail-tst-protected1b
= yes
347 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
348 modules-names
+= tst-piemod1
349 tests
+= tst-pie1 tst-pie2 tst-dlopen-pie tst-dlopen-tlsmodid-pie \
351 tests-pie
+= tst-pie1 tst-pie2 tst-dlopen-tlsmodid-pie tst-dlopen-self-pie
352 ifeq (yes
,$(have-protected-data
))
355 CFLAGS-vismain.c
+= $(PIE-ccflag
)
358 modules-execstack-yes
= tst-execstack-mod
359 extra-test-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
361 # filtmod1.so, tst-big-note-lib.so have special rules.
362 modules-names-nobuild
:= filtmod1 tst-big-note-lib
364 tests
+= $(tests-static
)
366 ifeq (yes
,$(have-ifunc
))
367 tests-ifuncstatic
:= ifuncmain1static ifuncmain1picstatic \
368 ifuncmain2static ifuncmain2picstatic \
369 ifuncmain4static ifuncmain4picstatic \
370 ifuncmain5static ifuncmain5picstatic \
371 ifuncmain7static ifuncmain7picstatic \
372 ifuncmain9static ifuncmain9picstatic
373 tests-static
+= $(tests-ifuncstatic
)
374 tests-internal
+= $(tests-ifuncstatic
)
375 ifeq (yes
,$(build-shared
))
376 tests
+= tst-ifunc-fault-lazy tst-ifunc-fault-bindnow
377 # Note: sysdeps/x86_64/ifuncmain8.c uses ifuncmain8.
379 ifuncmain1 ifuncmain1pic ifuncmain1vis ifuncmain1vispic \
380 ifuncmain1staticpic \
381 ifuncmain2 ifuncmain2pic ifuncmain3 ifuncmain4 \
382 ifuncmain5 ifuncmain5pic ifuncmain5staticpic \
383 ifuncmain7 ifuncmain7pic \
384 ifuncmain9 ifuncmain9pic
385 ifunc-test-modules
= ifuncdep1 ifuncdep1pic ifuncdep2 ifuncdep2pic \
386 ifuncdep5 ifuncdep5pic
387 extra-test-objs
+= $(ifunc-test-modules
:=.o
)
388 test-internal-extras
+= $(ifunc-test-modules
)
389 ifeq (yes
,$(have-fpie
))
390 ifunc-pie-tests
= ifuncmain1pie ifuncmain1vispie ifuncmain1staticpie \
391 ifuncmain5pie ifuncmain6pie ifuncmain7pie ifuncmain9pie
392 ifeq (yes
,$(have-textrel_ifunc
))
393 ifunc-pie-tests
+= tst-ifunc-textrel
395 tests-internal
+= $(ifunc-pie-tests
)
396 tests-pie
+= $(ifunc-pie-tests
)
398 modules-names
+= ifuncmod1 ifuncmod3 ifuncmod5 ifuncmod6
402 ifeq (yes
,$(build-shared
))
403 ifeq ($(run-built-tests
),yes
)
404 tests-special
+= $(objpfx
)tst-pathopt.out
$(objpfx
)tst-rtld-load-self.out \
405 $(objpfx
)tst-rtld-preload.out
407 tests-special
+= $(objpfx
)check-textrel.out
$(objpfx
)check-execstack.out \
408 $(objpfx
)check-wx-segment.out \
409 $(objpfx
)check-localplt.out
$(objpfx
)check-initfini.out
412 ifeq ($(run-built-tests
),yes
)
413 tests-special
+= $(objpfx
)order-cmp.out
$(objpfx
)tst-array1-cmp.out \
414 $(objpfx
)tst-array1-static-cmp.out \
415 $(objpfx
)tst-array2-cmp.out
$(objpfx
)tst-array3-cmp.out \
416 $(objpfx
)tst-array4-cmp.out
$(objpfx
)tst-array5-cmp.out \
417 $(objpfx
)tst-array5-static-cmp.out
$(objpfx
)order2-cmp.out \
418 $(objpfx
)tst-initorder-cmp.out \
419 $(objpfx
)tst-initorder2-cmp.out
$(objpfx
)tst-unused-dep.out \
420 $(objpfx
)tst-unused-dep-cmp.out
423 check-abi
: $(objpfx
)check-abi-ld.out
424 tests-special
+= $(objpfx
)check-abi-ld.out
425 update-abi
: update-abi-ld
426 update-all-abi
: update-all-abi-ld
428 ifeq ($(have-glob-dat-reloc
),yes
)
430 # Don't compile tst-prelink.c with PIE for GLOB_DAT relocation.
431 CFLAGS-tst-prelink.c
+= -fno-pie
432 tst-prelink-no-pie
= yes
433 ifeq ($(run-built-tests
),yes
)
434 tests-special
+= $(objpfx
)tst-prelink-cmp.out
438 # The test requires shared _and_ PIE because the executable
439 # unit test driver must be able to link with the shared object
440 # that is going to eventually go into an installed DSO.
441 ifeq (yesyes
,$(have-fpie
)$(build-shared
))
442 tests-internal
+= tst-_dl_addr_inside_object
443 tests-pie
+= tst-_dl_addr_inside_object
444 $(objpfx
)tst-_dl_addr_inside_object
: $(objpfx
)dl-addr-obj.os
445 CFLAGS-tst-_dl_addr_inside_object.c
+= $(PIE-ccflag
)
448 # We can only test static libcrypt use if libcrypt has been built,
449 # and either NSS crypto is not in use, or static NSS libraries are
451 ifeq ($(build-crypt
),no
)
452 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=0
454 ifeq ($(nss-crypt
),no
)
455 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=1
457 ifeq ($(static-nss-crypt
),no
)
458 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=0
460 CFLAGS-tst-linkall-static.c
+= -DUSE_CRYPT
=1
467 ifeq (yes
,$(build-shared
))
468 # Make sure these things are built in the `make lib' pass so they can be used
469 # to run programs during the `make others' pass.
470 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
471 $(addprefix $(objpfx
),$(extra-objs
))
474 # Command to link into a larger single relocatable object.
475 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
477 $(objpfx
)sotruss-lib.so
: $(shlib-lds
)
479 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
480 $(reloc-link
) -o
$@
$^
482 # Link together the dynamic linker into a single relocatable object.
483 # First we do a link against libc_pic.a just to get a link map,
484 # and discard the object produced by that link. From the link map
485 # we can glean all the libc modules that need to go into the dynamic
486 # linker. Then we do a recursive make that goes into all the subdirs
487 # those modules come from and builds special rtld-foo.os versions that
488 # are compiled with special flags, and puts these modules into rtld-libc.a
489 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
491 # These symbols need to be stubbed out during symbol discovery because
492 # their implementation is provided differently in rtld, and the symbol
493 # discovery mechanism is not compatible with the libc implementation
494 # when compiled for libc.
495 rtld-stubbed-symbols
= \
501 # The GCC arguments that implement $(rtld-stubbed-symbols).
502 rtld-stubbed-symbols-args
= \
503 $(patsubst %,-Wl
$(comma
)--defsym
=%=0, $(rtld-stubbed-symbols
))
505 ifeq ($(have-ssp
),yes
)
506 # rtld is not built with the stack protector, so these references will
507 # go away in the rebuilds.
508 rtld-stubbed-symbols
+= __stack_chk_fail __stack_chk_fail_local
511 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
513 $(reloc-link
) -o
$@.o
$(rtld-stubbed-symbols-args
) \
514 '-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
518 # For lld, skip preceding addresses and values before matching the archive and the member.
519 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
521 sed
-n
's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
523 while read lib file
; do \
526 LC_ALL
=C fgrep
-l
/$$file \
527 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
529 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
532 echo rtld-
$${lib
%%/*} += $$file ;; \
533 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
536 echo rtld-subdirs
= `LC_ALL=C sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
537 | LC_ALL=C sort -u` >> $@T
540 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
541 $(MAKE
) -f
$< -f rtld-Rules
543 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
544 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)' \
547 generated
+= librtld.map librtld.mk rtld-libc.a librtld.os.map
549 z-now-yes
= -Wl
,-z
,now
551 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
552 # Link into a temporary file so that we don't touch $@ at all
553 # if the sanity check below fails.
554 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@.new \
555 $(LDFLAGS-rtld
) -Wl
,-z
,defs
$(z-now-
$(bind-now
)) \
556 $(filter-out $(map-file
),$^
) $(load-map-file
) \
557 -Wl
,-soname
=$(rtld-installed-name
) \
559 $(call after-link
,$@.new
)
560 $(READELF
) -s
$@.new \
561 |
$(AWK
) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
564 ifeq (yes
,$(build-shared
))
565 # interp.c exists just to get the runtime linker path into libc.so.
566 $(objpfx
)interp.os
: $(common-objpfx
)runtime-linker.h
569 ifneq (ld.so
,$(rtld-installed-name
))
570 # Make sure ld.so.1 exists in the build directory so we can link
572 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
574 generated
+= $(rtld-installed-name
)
577 # Build a file mentioning all trustworthy directories to look for shared
578 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
579 # add directories to the list by defining $(user-defined-trusted-dirs)
580 # before starting make.
581 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
582 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
583 $(make-target-directory
)
584 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
585 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
586 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
587 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
589 CPPFLAGS-dl-load.c
+= -I
$(objpfx
).
-I
$(csu-objpfx
).
591 ifeq (yes
,$(build-shared
))
592 $(inst_slibdir
)/$(rtld-version-installed-name
): $(objpfx
)ld.so
$(+force)
593 $(make-target-directory
)
594 $(do-install-program
)
596 $(inst_rtlddir
)/$(rtld-installed-name
): \
597 $(inst_slibdir
)/$(rtld-version-installed-name
) \
598 $(inst_slibdir
)/libc-
$(version
).so
599 $(make-target-directory
)
602 # Special target called by parent to install just the dynamic linker.
604 ldso_install
: $(inst_rtlddir
)/$(rtld-installed-name
)
608 ldd-rewrite
= -e
's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
609 -e
's%@VERSION@%$(version)%g' \
610 -e
's|@PKGVERSION@|$(PKGVERSION)|g' \
611 -e
's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
612 -e
's%@BASH@%$(BASH)%g' \
613 -e
's%@TEXTDOMAINDIR@%$(localedir)%g'
615 ifeq ($(ldd-rewrite-script
),no
)
617 LC_ALL
=C sed
$(ldd-rewrite
) < $< > $@.new
621 LC_ALL
=C sed
$(ldd-rewrite
) < $< \
622 | LC_ALL
=C sed
-f
$(patsubst $(..
)/%,/%,$(..
)$(ldd-rewrite-script
)) > $@.new
626 $(objpfx
)ldd
: ldd.bash.in
$(common-objpfx
)soversions.mk \
627 $(common-objpfx
)config.make
632 $(objpfx
)sprof
: $(libdl
)
634 $(objpfx
)sln
: $(sln-modules
:%=$(objpfx
)%.o
)
636 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
638 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
639 CFLAGS-ldconfig.c
+= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' \
640 -D
'SLIBDIR="$(slibdir)"'
641 libof-ldconfig
= ldconfig
642 CFLAGS-dl-cache.c
+= $(SYSCONF-FLAGS
)
643 CFLAGS-cache.c
+= $(SYSCONF-FLAGS
)
644 CFLAGS-rtld.c
+= $(SYSCONF-FLAGS
)
646 cpp-srcs-left
:= $(all-rtld-routines
:=.os
)
648 include $(patsubst %,$(..
)libof-iterator.mk
,$(cpp-srcs-left
))
650 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
651 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
653 $(objpfx
)testobj1.so
: $(libdl
)
654 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
$(libdl
)
655 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
$(libdl
)
656 $(objpfx
)testobj3.so
: $(libdl
)
657 $(objpfx
)testobj4.so
: $(libdl
)
658 $(objpfx
)testobj5.so
: $(libdl
)
659 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
$(libdl
)
660 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
661 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
662 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
663 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
664 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
665 $(objpfx
)nextmod1.so
: $(libdl
)
666 $(objpfx
)neededobj1.so
: $(libdl
)
667 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
$(libdl
)
668 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
$(libdl
)
669 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
670 $(objpfx
)neededobj3.so
$(libdl
)
671 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
672 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
673 $(objpfx
)ltglobmod2.so
: $(libdl
)
674 $(objpfx
)firstobj.so
: $(shared-thread-library
)
675 $(objpfx
)globalmod1.so
: $(libdl
)
676 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
677 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
678 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
679 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
680 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
681 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
682 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
683 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
684 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
685 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
686 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
687 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
688 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
689 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
690 $(objpfx
)tst-tlsmod13a.so
: $(objpfx
)tst-tlsmod13.so
691 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
692 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
693 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
694 $(objpfx
)tst-tls19mod1.so
: $(objpfx
)tst-tls19mod2.so
$(objpfx
)tst-tls19mod3.so
695 $(objpfx
)tst-tls19mod3.so
: $(objpfx
)ld.so
696 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
697 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
698 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
699 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
700 $(objpfx
)unload3mod1.so
: $(objpfx
)unload3mod3.so
701 $(objpfx
)unload3mod2.so
: $(objpfx
)unload3mod3.so
702 $(objpfx
)unload3mod3.so
: $(objpfx
)unload3mod4.so
703 $(objpfx
)unload4mod1.so
: $(objpfx
)unload4mod2.so
$(objpfx
)unload4mod3.so
704 $(objpfx
)unload4mod2.so
: $(objpfx
)unload4mod4.so
$(objpfx
)unload4mod3.so
705 $(objpfx
)unload6mod1.so
: $(libdl
)
706 $(objpfx
)unload6mod2.so
: $(libdl
)
707 $(objpfx
)unload6mod3.so
: $(libdl
)
708 $(objpfx
)unload7mod1.so
: $(libdl
)
709 $(objpfx
)unload7mod2.so
: $(objpfx
)unload7mod1.so
710 $(objpfx
)unload8mod1.so
: $(objpfx
)unload8mod2.so
711 $(objpfx
)unload8mod2.so
: $(objpfx
)unload8mod3.so
712 $(objpfx
)unload8mod3.so
: $(libdl
)
713 $(objpfx
)tst-initordera2.so
: $(objpfx
)tst-initordera1.so
714 $(objpfx
)tst-initorderb2.so
: $(objpfx
)tst-initorderb1.so
$(objpfx
)tst-initordera2.so
715 $(objpfx
)tst-initordera3.so
: $(objpfx
)tst-initorderb2.so
$(objpfx
)tst-initorderb1.so
716 $(objpfx
)tst-initordera4.so
: $(objpfx
)tst-initordera3.so
717 $(objpfx
)tst-initorder
: $(objpfx
)tst-initordera4.so
$(objpfx
)tst-initordera1.so
$(objpfx
)tst-initorderb2.so
718 $(objpfx
)tst-null-argv
: $(objpfx
)tst-null-argv-lib.so
719 $(objpfx
)tst-tlsalign
: $(objpfx
)tst-tlsalign-lib.so
720 $(objpfx
)tst-nodelete-opened.out
: $(objpfx
)tst-nodelete-opened-lib.so
721 $(objpfx
)tst-nodelete-opened
: $(libdl
)
722 $(objpfx
)tst-noload
: $(libdl
)
724 $(objpfx
)tst-tlsalign-extern
: $(objpfx
)tst-tlsalign-vars.o
725 $(objpfx
)tst-tlsalign-extern-static
: $(objpfx
)tst-tlsalign-vars.o
727 tst-null-argv-ENV
= LD_DEBUG
=all LD_DEBUG_OUTPUT
=$(objpfx
)tst-null-argv.debug.out
728 LDFLAGS-nodel2mod3.so
= -Wl
,--no-as-needed
729 LDFLAGS-reldepmod5.so
= -Wl
,--no-as-needed
730 LDFLAGS-reldep6mod1.so
= -Wl
,--no-as-needed
731 LDFLAGS-reldep6mod4.so
= -Wl
,--no-as-needed
732 LDFLAGS-reldep8mod3.so
= -Wl
,--no-as-needed
733 LDFLAGS-unload4mod1.so
= -Wl
,--no-as-needed
734 LDFLAGS-unload4mod2.so
= -Wl
,--no-as-needed
735 LDFLAGS-tst-initorder
= -Wl
,--no-as-needed
736 LDFLAGS-tst-initordera2.so
= -Wl
,--no-as-needed
737 LDFLAGS-tst-initordera3.so
= -Wl
,--no-as-needed
738 LDFLAGS-tst-initordera4.so
= -Wl
,--no-as-needed
739 LDFLAGS-tst-initorderb2.so
= -Wl
,--no-as-needed
740 LDFLAGS-tst-tlsmod5.so
= -nostdlib
-Wl
,--no-as-needed
741 LDFLAGS-tst-tlsmod6.so
= -nostdlib
-Wl
,--no-as-needed
743 testobj1.so-no-z-defs
= yes
744 testobj3.so-no-z-defs
= yes
745 testobj4.so-no-z-defs
= yes
746 testobj5.so-no-z-defs
= yes
747 testobj6.so-no-z-defs
= yes
748 failobj.so-no-z-defs
= yes
749 constload2.so-no-z-defs
= yes
750 constload3.so-no-z-defs
= yes
751 nodelmod1.so-no-z-defs
= yes
752 nodelmod2.so-no-z-defs
= yes
753 nodelmod4.so-no-z-defs
= yes
754 nodel2mod2.so-no-z-defs
= yes
755 reldepmod2.so-no-z-defs
= yes
756 reldepmod3.so-no-z-defs
= yes
757 reldepmod4.so-no-z-defs
= yes
758 reldep4mod4.so-no-z-defs
= yes
759 reldep4mod2.so-no-z-defs
= yes
760 ltglobmod2.so-no-z-defs
= yes
761 dblloadmod3.so-no-z-defs
= yes
762 tst-tlsmod1.so-no-z-defs
= yes
763 tst-tlsmod2.so-no-z-defs
= yes
764 tst-tlsmod3.so-no-z-defs
= yes
765 tst-tlsmod4.so-no-z-defs
= yes
766 tst-tlsmod7.so-no-z-defs
= yes
767 tst-tlsmod8.so-no-z-defs
= yes
768 tst-tlsmod9.so-no-z-defs
= yes
769 tst-tlsmod10.so-no-z-defs
= yes
770 tst-tlsmod12.so-no-z-defs
= yes
771 tst-tlsmod14a.so-no-z-defs
= yes
772 tst-tlsmod14b.so-no-z-defs
= yes
773 tst-tlsmod15a.so-no-z-defs
= yes
774 tst-tlsmod16b.so-no-z-defs
= yes
775 circlemod2.so-no-z-defs
= yes
776 circlemod3.so-no-z-defs
= yes
777 circlemod3a.so-no-z-defs
= yes
778 reldep8mod2.so-no-z-defs
= yes
779 reldep9mod1.so-no-z-defs
= yes
780 unload3mod4.so-no-z-defs
= yes
781 unload4mod1.so-no-z-defs
= yes
782 ifuncmod1.so-no-z-defs
= yes
783 ifuncmod5.so-no-z-defs
= yes
784 ifuncmod6.so-no-z-defs
= yes
785 tst-auditmod9a.so-no-z-defs
= yes
786 tst-auditmod9b.so-no-z-defs
= yes
787 tst-nodelete-uniquemod.so-no-z-defs
= yes
788 tst-nodelete-rtldmod.so-no-z-defs
= yes
789 tst-nodelete-zmod.so-no-z-defs
= yes
790 tst-nodelete2mod.so-no-z-defs
= yes
792 ifeq ($(build-shared
),yes
)
793 # Build all the modules even when not actually running test programs.
794 tests
: $(test-modules
)
797 $(objpfx
)loadtest
: $(libdl
)
798 LDFLAGS-loadtest
= -rdynamic
800 $(objpfx
)loadtest.out
: $(test-modules
)
802 $(objpfx
)neededtest
: $(libdl
)
803 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
804 $(objpfx
)neededobj3.so
806 $(objpfx
)neededtest2
: $(libdl
)
807 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
808 $(objpfx
)neededobj3.so
810 $(objpfx
)neededtest3
: $(libdl
)
811 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
812 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
814 $(objpfx
)neededtest4
: $(libdl
) $(objpfx
)neededobj1.so
815 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
817 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
$(libdl
)
818 LDFLAGS-restest1
= -rdynamic
820 $(objpfx
)restest2
: $(libdl
)
821 LDFLAGS-restest2
= -rdynamic
823 $(objpfx
)restest1.out
: $(test-modules
)
825 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
826 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
827 LDFLAGS-preloadtest
= -rdynamic
828 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
830 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
832 $(objpfx
)loadfail
: $(libdl
)
833 LDFLAGS-loadfail
= -rdynamic
835 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
837 $(objpfx
)multiload
: $(libdl
)
838 LDFLAGS-multiload
= -rdynamic
839 CFLAGS-multiload.c
+= -DOBJDIR
=\"$(elf-objpfx
)\"
841 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
843 $(objpfx
)origtest
: $(libdl
)
844 LDFLAGS-origtest
= -rdynamic
845 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
847 ifeq ($(have-thread-library
),yes
)
848 $(objpfx
)resolvfail
: $(libdl
) $(shared-thread-library
)
850 $(objpfx
)resolvfail
: $(libdl
)
853 $(objpfx
)constload1
: $(libdl
)
854 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
856 $(objpfx
)circleload1
: $(libdl
)
857 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
858 $(objpfx
)circlemod1a.so
860 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
861 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
862 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
863 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
865 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
867 $(objpfx
)order-cmp.out
: $(objpfx
)order.out
868 (echo
"0123456789" | cmp
$< -) > $@
; \
871 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
872 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
873 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
875 $(objpfx
)noload
: $(objpfx
)testobj1.so
$(libdl
)
876 LDFLAGS-noload
= -rdynamic
-Wl
,--no-as-needed
877 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
879 $(objpfx
)noload-mem.out
: $(objpfx
)noload.out
880 $(common-objpfx
)malloc
/mtrace
$(objpfx
)noload.mtrace
> $@
; \
882 noload-ENV
= MALLOC_TRACE
=$(objpfx
)noload.mtrace
884 LDFLAGS-nodelete
= -rdynamic
885 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
886 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
887 $(objpfx
)nodelete
: $(libdl
)
888 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
889 $(objpfx
)nodelmod3.so
891 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
892 $(objpfx
)nodlopen
: $(libdl
)
893 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
895 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
896 $(objpfx
)nodlopen2
: $(libdl
)
897 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
899 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
900 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
901 -L
$(subst :, -L
,$(rpath-link
)) \
902 -Wl
,-rpath-link
=$(rpath-link
) \
903 $< -Wl
,-F
,$(objpfx
)filtmod2.so
904 $(objpfx
)filter: $(objpfx
)filtmod1.so
906 # This does not link against libc.
907 CFLAGS-filtmod1.c
+= $(no-stack-protector
)
909 $(objpfx
)unload
: $(libdl
)
910 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
912 $(objpfx
)reldep
: $(libdl
)
913 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
915 $(objpfx
)reldep2
: $(libdl
)
916 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
918 $(objpfx
)reldep3
: $(libdl
)
919 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
921 $(objpfx
)reldep4
: $(libdl
)
922 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
924 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
$(libdl
)
925 LDFLAGS-next
= -Wl
,--no-as-needed
927 $(objpfx
)unload2
: $(libdl
)
928 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
930 $(objpfx
)lateglobal
: $(libdl
)
931 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
933 $(objpfx
)tst-pathopt
: $(libdl
)
934 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
935 $(objpfx
)pathoptobj.so
936 $(SHELL
) $< $(common-objpfx
) '$(test-wrapper-env)' \
937 '$(run-program-env)' > $@
; \
940 $(objpfx
)tst-rtld-load-self.out
: tst-rtld-load-self.sh
$(objpfx
)ld.so
941 $(SHELL
) $^
'$(test-wrapper)' '$(test-wrapper-env)' > $@
; \
944 tst-rtld-preload-OBJS
= $(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
945 $(objpfx
)tst-rtld-preload.out
: tst-rtld-preload.sh
$(objpfx
)ld.so \
946 $(objpfx
)preloadtest \
947 $(preloadtest-preloads
:%=$(objpfx
)%.so
)
948 $(SHELL
) $< $(objpfx
)ld.so
$(objpfx
)preloadtest \
949 '$(test-wrapper-env)' '$(run_program_env)' \
950 '$(rpath-link)' '$(tst-rtld-preload-OBJS)' > $@
; \
953 $(objpfx
)initfirst
: $(libdl
)
954 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
956 $(objpfx
)global
: $(objpfx
)globalmod1.so
957 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
959 $(objpfx
)dblload
: $(libdl
)
960 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
962 $(objpfx
)dblunload
: $(libdl
)
963 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
965 $(objpfx
)reldep5
: $(libdl
)
966 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod6.so
968 $(objpfx
)reldep6
: $(libdl
)
969 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
971 $(objpfx
)reldep7
: $(libdl
)
972 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
974 $(objpfx
)reldep8
: $(libdl
)
975 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
977 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
978 $(objpfx
)nodelete2
: $(libdl
)
979 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
981 $(objpfx
)reldep9
: $(libdl
)
982 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
984 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
986 $(objpfx
)tst-tls4
: $(libdl
)
987 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
989 $(objpfx
)tst-tls5
: $(libdl
)
990 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
992 $(objpfx
)tst-tls6
: $(libdl
)
993 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
995 $(objpfx
)tst-tls7
: $(libdl
)
996 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
998 $(objpfx
)tst-tls8
: $(libdl
)
999 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
1001 $(objpfx
)tst-tls9
: $(libdl
)
1002 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1004 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
$(objpfx
)tst-tlsmod7.so
1006 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
$(objpfx
)tst-tlsmod9.so
1008 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
$(objpfx
)tst-tlsmod11.so
1010 $(objpfx
)tst-tls13
: $(libdl
)
1011 $(objpfx
)tst-tls13.out
: $(objpfx
)tst-tlsmod13a.so
1013 $(objpfx
)tst-tls14
: $(objpfx
)tst-tlsmod14a.so
$(libdl
)
1014 $(objpfx
)tst-tls14.out
: $(objpfx
)tst-tlsmod14b.so
1016 $(objpfx
)tst-tls15
: $(libdl
)
1017 $(objpfx
)tst-tls15.out
: $(objpfx
)tst-tlsmod15a.so
$(objpfx
)tst-tlsmod15b.so
1019 $(objpfx
)tst-tls-dlinfo
: $(libdl
)
1020 $(objpfx
)tst-tls-dlinfo.out
: $(objpfx
)tst-tlsmod2.so
1024 $(objpfx
)tst-tls16
: $(libdl
)
1025 $(objpfx
)tst-tls16.out
: $(objpfx
)tst-tlsmod16a.so
$(objpfx
)tst-tlsmod16b.so
1027 $(objpfx
)tst-tls17
: $(libdl
)
1028 $(objpfx
)tst-tls17.out
: $(objpfx
)tst-tlsmod17b.so
1029 $(patsubst %,$(objpfx
)%.os
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.os
: tst-tlsmod17a.c
1030 $(compile-command.c
) -DN
=$*
1031 $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
)): $(objpfx
)tst-tlsmod17a
%.so
: $(objpfx
)ld.so
1032 $(objpfx
)tst-tlsmod17b.so
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod17a-modules
))
1034 $(objpfx
)tst-tls18
: $(libdl
)
1035 $(objpfx
)tst-tls18.out
: $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
))
1036 $(patsubst %,$(objpfx
)%.os
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.os
: tst-tlsmod18a.c
1037 $(compile-command.c
) -DN
=$*
1038 $(patsubst %,$(objpfx
)%.so
,$(tlsmod18a-modules
)): $(objpfx
)tst-tlsmod18a
%.so
: $(objpfx
)ld.so
1040 $(objpfx
)tst-tls19
: $(libdl
)
1041 $(objpfx
)tst-tls19.out
: $(objpfx
)tst-tls19mod1.so
1043 CFLAGS-tst-align.c
+= $(stack-align-test-flags
)
1044 CFLAGS-tst-align2.c
+= $(stack-align-test-flags
)
1045 CFLAGS-tst-alignmod.c
+= $(stack-align-test-flags
)
1046 CFLAGS-tst-alignmod2.c
+= $(stack-align-test-flags
)
1047 $(objpfx
)tst-align
: $(libdl
)
1048 $(objpfx
)tst-align.out
: $(objpfx
)tst-alignmod.so
1049 $(objpfx
)tst-align2
: $(objpfx
)tst-alignmod2.so
1051 $(objpfx
)unload3
: $(libdl
)
1052 $(objpfx
)unload3.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1053 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1055 $(objpfx
)unload4
: $(libdl
)
1056 $(objpfx
)unload4.out
: $(objpfx
)unload4mod1.so
$(objpfx
)unload4mod3.so
1058 $(objpfx
)unload5
: $(libdl
)
1059 $(objpfx
)unload5.out
: $(objpfx
)unload3mod1.so
$(objpfx
)unload3mod2.so \
1060 $(objpfx
)unload3mod3.so
$(objpfx
)unload3mod4.so
1062 $(objpfx
)unload6
: $(libdl
)
1063 $(objpfx
)unload6.out
: $(objpfx
)unload6mod1.so
$(objpfx
)unload6mod2.so \
1064 $(objpfx
)unload6mod3.so
1066 $(objpfx
)unload7
: $(libdl
)
1067 $(objpfx
)unload7.out
: $(objpfx
)unload7mod1.so
$(objpfx
)unload7mod2.so
1068 unload7-ENV
= MALLOC_PERTURB_
=85
1070 $(objpfx
)unload8
: $(libdl
)
1071 $(objpfx
)unload8.out
: $(objpfx
)unload8mod1.so
$(objpfx
)unload8mod1x.so
1074 $(objpfx
)tst-tls9-static
: $(common-objpfx
)dlfcn
/libdl.a
1075 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
1078 ifeq ($(have-z-execstack
),yes
)
1079 $(objpfx
)tst-execstack
: $(libdl
)
1080 $(objpfx
)tst-execstack.out
: $(objpfx
)tst-execstack-mod.so
1081 CPPFLAGS-tst-execstack.c
+= -DUSE_PTHREADS
=0
1082 LDFLAGS-tst-execstack
= -Wl
,-z
,noexecstack
1083 LDFLAGS-tst-execstack-mod.so
= -Wl
,-z
,execstack
1085 $(objpfx
)tst-execstack-needed
: $(objpfx
)tst-execstack-mod.so
1086 LDFLAGS-tst-execstack-needed
= -Wl
,-z
,noexecstack
1088 LDFLAGS-tst-execstack-prog
= -Wl
,-z
,execstack
1089 CFLAGS-tst-execstack-prog.c
+= -Wno-trampolines
1090 CFLAGS-tst-execstack-mod.c
+= -Wno-trampolines
1093 LDFLAGS-tst-array2
= -Wl
,--no-as-needed
1094 LDFLAGS-tst-array5
= -Wl
,--no-as-needed
1096 $(objpfx
)tst-array1-cmp.out
: tst-array1.exp
$(objpfx
)tst-array1.out
1100 $(objpfx
)tst-array1-static-cmp.out
: tst-array1.exp \
1101 $(objpfx
)tst-array1-static.out
1105 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
1106 $(objpfx
)tst-array2-cmp.out
: tst-array2.exp
$(objpfx
)tst-array2.out
1110 $(objpfx
)tst-array3-cmp.out
: tst-array1.exp
$(objpfx
)tst-array3.out
1114 $(objpfx
)tst-array4
: $(libdl
)
1115 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array2dep.so
1116 $(objpfx
)tst-array4-cmp.out
: tst-array4.exp
$(objpfx
)tst-array4.out
1120 $(objpfx
)tst-array5
: $(objpfx
)tst-array5dep.so
1121 $(objpfx
)tst-array5-cmp.out
: tst-array5.exp
$(objpfx
)tst-array5.out
1125 $(objpfx
)tst-array5-static-cmp.out
: tst-array5-static.exp \
1126 $(objpfx
)tst-array5-static.out
1130 CFLAGS-tst-pie1.c
+= $(pie-ccflag
)
1131 CFLAGS-tst-pie2.c
+= $(pie-ccflag
)
1133 $(objpfx
)tst-piemod1.so
: $(libsupport
)
1134 $(objpfx
)tst-pie1
: $(objpfx
)tst-piemod1.so
1135 $(objpfx
)tst-dlopen-pie
: $(libdl
)
1136 $(objpfx
)tst-dlopen-pie.out
: $(objpfx
)tst-pie1
1138 ifeq (yes
,$(build-shared
))
1139 # NB: Please keep cet-built-dso in sysdeps/x86/Makefile in sync with
1140 # all-built-dso here.
1141 all-built-dso
:= $(common-objpfx
)elf
/ld.so
$(common-objpfx
)libc.so \
1142 $(filter-out $(common-objpfx
)linkobj
/libc.so
, \
1143 $(sort $(wildcard $(addprefix $(common-objpfx
), \
1147 $(all-built-dso
:=.dyn
): %.dyn
: %
1149 LC_ALL
=C
$(READELF
) -W
-d
$< > $@T
1152 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dyn
)
1154 $(objpfx
)check-textrel.out
: $(..
)scripts
/check-textrel.awk \
1155 $(all-built-dso
:=.dyn
)
1156 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1158 generated
+= check-textrel.out
1160 $(objpfx
)execstack-default
: $(first-word
$(wildcard $(sysdirs
:%=%/stackinfo.h
)))
1161 $(make-target-directory
)
1162 { echo
'#include <elf.h>'; \
1163 echo
'#include <stackinfo.h>'; \
1164 echo
'#if (DEFAULT_STACK_PERMS & PF_X) == 0'; \
1165 echo
'@@@execstack-no@@@'; \
1167 echo
'@@@execstack-yes@@@'; \
1168 echo
'#endif'; } | \
1169 $(CC
) $(CFLAGS
) $(CPPFLAGS
) -E
-x c-header
- | \
1170 sed
-n
-e
's/^@@@\(.*\)@@@/\1/p' > $@T
1172 generated
+= execstack-default
1174 $(all-built-dso
:=.phdr
): %.phdr
: %
1176 LC_ALL
=C
$(READELF
) -W
-l
$< > $@T
1179 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.phdr
)
1181 $(objpfx
)check-execstack.out
: $(..
)scripts
/check-execstack.awk \
1182 $(objpfx
)execstack-default \
1183 $(all-built-dso
:=.phdr
)
1184 LC_ALL
=C
$(AWK
) -v
"xfail=$(check-execstack-xfail)" -f
$^
> $@
; \
1186 generated
+= check-execstack.out
1188 $(objpfx
)check-wx-segment.out
: $(..
)scripts
/check-wx-segment.py \
1189 $(all-built-dso
:=.phdr
)
1190 $(PYTHON
) $^
--xfail
="$(check-wx-segment-xfail)" > $@
; \
1192 generated
+= check-wx-segment.out
1194 $(objpfx
)tst-dlmodcount
: $(libdl
)
1195 $(objpfx
)tst-dlmodcount.out
: $(test-modules
)
1197 $(all-built-dso
:=.jmprel
): %.jmprel
: % Makefile
1199 LC_ALL
=C
$(READELF
) -W
-S
-d
-r
$< > $@T
1202 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.jmprel
)
1204 localplt-built-dso
:= $(addprefix $(common-objpfx
),\
1210 resolv
/libresolv.so \
1212 ifeq ($(build-mathvec
),yes
)
1213 localplt-built-dso
+= $(addprefix $(common-objpfx
), mathvec
/libmvec.so
)
1215 ifeq ($(have-thread-library
),yes
)
1216 localplt-built-dso
+= $(filter-out %_nonshared.a
, $(shared-thread-library
))
1218 ifeq ($(build-crypt
),yes
)
1219 localplt-built-dso
+= $(addprefix $(common-objpfx
), crypt
/libcrypt.so
)
1222 vpath localplt.data
$(+sysdep_dirs
)
1224 $(objpfx
)check-localplt.out
: $(..
)scripts
/check-localplt.awk \
1225 $(..
)scripts
/localplt.awk \
1226 $(localplt-built-dso
:=.jmprel
) \
1228 LC_ALL
=C
$(AWK
) -f
$(filter-out $< %localplt.data
,$^
) | \
1229 LC_ALL
=C
$(AWK
) -f
$< $(filter %localplt.data
,$^
) - \
1234 $(all-built-dso
:=.dynsym
): %.dynsym
: %
1236 LC_ALL
=C
$(READELF
) -W
--dyn-syms
$< > $@T
1239 common-generated
+= $(all-built-dso
:$(common-objpfx
)%=%.dynsym
)
1241 $(objpfx
)check-initfini.out
: $(..
)scripts
/check-initfini.awk \
1242 $(all-built-dso
:=.dynsym
)
1243 LC_ALL
=C
$(AWK
) -f
$^
> $@
; \
1245 generated
+= check-initfini.out
1247 $(objpfx
)tst-dlopenrpathmod.so
: $(libdl
)
1248 $(objpfx
)tst-dlopenrpath
: $(objpfx
)tst-dlopenrpathmod.so
$(libdl
)
1249 CFLAGS-tst-dlopenrpath.c
+= -DPFX
=\"$(objpfx
)\"
1250 LDFLAGS-tst-dlopenrpathmod.so
+= -Wl
,-rpath
,\
$$ORIGIN/test-subdir
1251 $(objpfx
)tst-dlopenrpath.out
: $(objpfx
)firstobj.so
1253 $(objpfx
)tst-deep1mod2.so
: $(objpfx
)tst-deep1mod3.so
1254 $(objpfx
)tst-deep1
: $(libdl
) $(objpfx
)tst-deep1mod1.so
1255 $(objpfx
)tst-deep1.out
: $(objpfx
)tst-deep1mod2.so
1256 LDFLAGS-tst-deep1
+= -rdynamic
1257 tst-deep1mod3.so-no-z-defs
= yes
1259 $(objpfx
)tst-dlmopen1mod.so
: $(libdl
)
1260 $(objpfx
)tst-dlmopen1
: $(libdl
)
1261 $(objpfx
)tst-dlmopen1.out
: $(objpfx
)tst-dlmopen1mod.so
1263 $(objpfx
)tst-dlmopen2
: $(libdl
)
1264 $(objpfx
)tst-dlmopen2.out
: $(objpfx
)tst-dlmopen1mod.so
1266 $(objpfx
)tst-dlmopen3
: $(libdl
)
1267 $(objpfx
)tst-dlmopen3.out
: $(objpfx
)tst-dlmopen1mod.so
1269 $(objpfx
)tst-audit1.out
: $(objpfx
)tst-auditmod1.so
1270 tst-audit1-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1272 $(objpfx
)tst-audit2
: $(libdl
)
1273 $(objpfx
)tst-audit2.out
: $(objpfx
)tst-auditmod1.so
$(objpfx
)tst-auditmod9b.so
1274 # Prevent GCC-5 from translating a malloc/memset pair into calloc
1275 CFLAGS-tst-audit2.c
+= -fno-builtin
1276 tst-audit2-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1278 $(objpfx
)tst-audit9
: $(libdl
)
1279 $(objpfx
)tst-audit9.out
: $(objpfx
)tst-auditmod9a.so
$(objpfx
)tst-auditmod9b.so
1280 tst-audit9-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod9a.so
1282 $(objpfx
)tst-audit8
: $(libm
)
1283 $(objpfx
)tst-audit8.out
: $(objpfx
)tst-auditmod1.so
1284 tst-audit8-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod1.so
1286 $(objpfx
)tst-global1
: $(libdl
)
1287 $(objpfx
)tst-global1.out
: $(objpfx
)testobj6.so
$(objpfx
)testobj2.so
1289 $(objpfx
)order2
: $(libdl
)
1290 $(objpfx
)order2.out
: $(objpfx
)order2mod1.so
$(objpfx
)order2mod2.so
1291 $(objpfx
)order2-cmp.out
: $(objpfx
)order2.out
1292 (echo
"12345" | cmp
$< -) > $@
; \
1294 $(objpfx
)order2mod1.so
: $(objpfx
)order2mod4.so
1295 $(objpfx
)order2mod4.so
: $(objpfx
)order2mod3.so
1296 $(objpfx
)order2mod2.so
: $(objpfx
)order2mod3.so
1297 order2mod2.so-no-z-defs
= yes
1298 LDFLAGS-order2mod1.so
= -Wl
,--no-as-needed
1299 LDFLAGS-order2mod2.so
= -Wl
,--no-as-needed
1301 tst-stackguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
1302 tst-stackguard1-static-ARGS
= --command
"$(objpfx)tst-stackguard1-static --child"
1304 tst-ptrguard1-ARGS
= --command
"$(host-test-program-cmd) --child"
1305 # When built statically, the pointer guard interface uses
1306 # __pointer_chk_guard_local.
1307 CFLAGS-tst-ptrguard1-static.c
+= -DPTRGUARD_LOCAL
1308 tst-ptrguard1-static-ARGS
= --command
"$(objpfx)tst-ptrguard1-static --child"
1310 $(objpfx
)tst-leaks1
: $(libdl
)
1311 $(objpfx
)tst-leaks1-mem.out
: $(objpfx
)tst-leaks1.out
1312 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1.mtrace
> $@
; \
1315 $(objpfx
)tst-leaks1-static
: $(common-objpfx
)dlfcn
/libdl.a
1316 $(objpfx
)tst-leaks1-static-mem.out
: $(objpfx
)tst-leaks1-static.out
1317 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-leaks1-static.mtrace
> $@
; \
1320 tst-leaks1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1.mtrace
1321 tst-leaks1-static-ENV
= MALLOC_TRACE
=$(objpfx
)tst-leaks1-static.mtrace
1323 $(objpfx
)tst-addr1
: $(libdl
)
1325 $(objpfx
)tst-thrlock
: $(libdl
) $(shared-thread-library
)
1327 tst-tst-dlopen-tlsmodid-no-pie
= yes
1328 $(objpfx
)tst-dlopen-tlsmodid
: $(libdl
) $(shared-thread-library
)
1329 $(objpfx
)tst-dlopen-tlsmodid.out
: $(objpfx
)tst-dlopen-self
1330 CFLAGS-tst-dlopen-tlsmodid-pie.c
+= $(pie-ccflag
)
1331 $(objpfx
)tst-dlopen-tlsmodid-pie
: $(libdl
) $(shared-thread-library
)
1332 $(objpfx
)tst-dlopen-tlsmodid-pie.out
: $(objpfx
)tst-dlopen-self-pie
1333 $(objpfx
)tst-dlopen-tlsmodid-container
: $(libdl
) $(shared-thread-library
)
1334 LDFLAGS-tst-dlopen-tlsmodid-container
+= -Wl
,-rpath
,\
$$ORIGIN
1336 tst-tst-dlopen-self-no-pie
= yes
1337 $(objpfx
)tst-dlopen-self
: $(libdl
)
1338 CFLAGS-tst-dlopen-self-pie.c
+= $(pie-ccflag
)
1339 $(objpfx
)tst-dlopen-self-pie
: $(libdl
)
1340 $(objpfx
)tst-dlopen-self-container
: $(libdl
)
1341 LDFLAGS-tst-dlopen-self-container
+= -Wl
,-rpath
,\
$$ORIGIN
1343 CFLAGS-ifuncmain1pic.c
+= $(pic-ccflag
)
1344 CFLAGS-ifuncmain1picstatic.c
+= $(pic-ccflag
)
1345 CFLAGS-ifuncmain1staticpic.c
+= $(pic-ccflag
)
1346 CFLAGS-ifuncdep1pic.c
+= $(pic-ccflag
)
1347 CFLAGS-ifuncmain1vispic.c
+= $(pic-ccflag
)
1348 CFLAGS-ifuncmain2pic.c
+= $(pic-ccflag
)
1349 CFLAGS-ifuncmain2picstatic.c
+= $(pic-ccflag
)
1350 CFLAGS-ifuncdep2pic.c
+= $(pic-ccflag
)
1351 CFLAGS-ifuncmain4picstatic.c
+= $(pic-ccflag
)
1352 CFLAGS-ifuncmain5pic.c
+= $(pic-ccflag
)
1353 CFLAGS-ifuncmain5picstatic.c
+= $(pic-ccflag
)
1354 CFLAGS-ifuncmain5staticpic.c
+= $(pic-ccflag
)
1355 CFLAGS-ifuncdep5pic.c
+= $(pic-ccflag
)
1356 CFLAGS-ifuncmain7pic.c
+= $(pic-ccflag
)
1357 CFLAGS-ifuncmain7picstatic.c
+= $(pic-ccflag
)
1358 CFLAGS-ifuncmain9pic.c
+= $(pic-ccflag
)
1359 CFLAGS-ifuncmain9picstatic.c
+= $(pic-ccflag
)
1361 LDFLAGS-ifuncmain3
= -Wl
,-export-dynamic
1363 CFLAGS-ifuncmain1pie.c
+= $(pie-ccflag
)
1364 CFLAGS-ifuncmain1vispie.c
+= $(pie-ccflag
)
1365 CFLAGS-ifuncmain1staticpie.c
+= $(pie-ccflag
)
1366 CFLAGS-ifuncmain5pie.c
+= $(pie-ccflag
)
1367 CFLAGS-ifuncmain6pie.c
+= $(pie-ccflag
)
1368 CFLAGS-ifuncmain7pie.c
+= $(pie-ccflag
)
1369 CFLAGS-ifuncmain9pie.c
+= $(pie-ccflag
)
1370 CFLAGS-tst-ifunc-textrel.c
+= $(pic-ccflag
)
1372 $(objpfx
)ifuncmain1pie
: $(objpfx
)ifuncmod1.so
1373 $(objpfx
)ifuncmain1staticpie
: $(objpfx
)ifuncdep1pic.o
1374 $(objpfx
)ifuncmain1vispie
: $(objpfx
)ifuncmod1.so
1375 $(objpfx
)ifuncmain5pie
: $(objpfx
)ifuncmod5.so
1376 $(objpfx
)ifuncmain6pie
: $(objpfx
)ifuncmod6.so
1378 $(objpfx
)ifuncmain1
: $(addprefix $(objpfx
),ifuncmod1.so
)
1379 $(objpfx
)ifuncmain1pic
: $(addprefix $(objpfx
),ifuncmod1.so
)
1380 $(objpfx
)ifuncmain1staticpic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
1381 $(objpfx
)ifuncmain1static
: $(addprefix $(objpfx
),ifuncdep1.o
)
1382 $(objpfx
)ifuncmain1picstatic
: $(addprefix $(objpfx
),ifuncdep1pic.o
)
1383 $(objpfx
)ifuncmain1vis
: $(addprefix $(objpfx
),ifuncmod1.so
)
1384 $(objpfx
)ifuncmain1vispic
: $(addprefix $(objpfx
),ifuncmod1.so
)
1385 $(objpfx
)ifuncmain2
: $(addprefix $(objpfx
),ifuncdep2.o
)
1386 $(objpfx
)ifuncmain2pic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
1387 $(objpfx
)ifuncmain2static
: $(addprefix $(objpfx
),ifuncdep2.o
)
1388 $(objpfx
)ifuncmain2picstatic
: $(addprefix $(objpfx
),ifuncdep2pic.o
)
1390 $(objpfx
)ifuncmain3
: $(libdl
)
1391 $(objpfx
)ifuncmain3.out
: $(objpfx
)ifuncmod3.so
1393 $(objpfx
)ifuncmain5
: $(addprefix $(objpfx
),ifuncmod5.so
)
1394 $(objpfx
)ifuncmain5pic
: $(addprefix $(objpfx
),ifuncmod5.so
)
1395 $(objpfx
)ifuncmain5static
: $(addprefix $(objpfx
),ifuncdep5.o
)
1396 $(objpfx
)ifuncmain5staticpic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
1397 $(objpfx
)ifuncmain5picstatic
: $(addprefix $(objpfx
),ifuncdep5pic.o
)
1399 LDFLAGS-tst-ifunc-fault-lazy
= -Wl
,-z
,lazy
1400 LDFLAGS-tst-ifunc-fault-bindnow
= -Wl
,-z
,now
1401 define tst-ifunc-fault-script
1402 ( $(test-wrapper
) $(rtld-prefix
) --verify
$^ \
1403 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 $(rtld-prefix
) $^ \
1404 && $(test-wrapper-env
) LD_TRACE_LOADED_OBJECTS
=1 LD_DEBUG
=unused \
1406 ) > $@
; $(evaluate-test
)
1408 $(objpfx
)tst-ifunc-fault-lazy.out
: $(objpfx
)tst-ifunc-fault-lazy
$(objpfx
)ld.so
1409 $(tst-ifunc-fault-script
)
1410 $(objpfx
)tst-ifunc-fault-bindnow.out
: $(objpfx
)tst-ifunc-fault-bindnow \
1412 $(tst-ifunc-fault-script
)
1414 $(objpfx
)tst-unique1
: $(libdl
)
1415 $(objpfx
)tst-unique1.out
: $(objpfx
)tst-unique1mod1.so \
1416 $(objpfx
)tst-unique1mod2.so
1418 $(objpfx
)tst-unique2
: $(libdl
) $(objpfx
)tst-unique2mod1.so
1419 $(objpfx
)tst-unique2.out
: $(objpfx
)tst-unique2mod2.so
1421 $(objpfx
)tst-unique3
: $(libdl
) $(objpfx
)tst-unique3lib.so
1422 $(objpfx
)tst-unique3.out
: $(objpfx
)tst-unique3lib2.so
1424 $(objpfx
)tst-unique4
: $(objpfx
)tst-unique4lib.so
1426 $(objpfx
)tst-nodelete
: $(libdl
)
1427 $(objpfx
)tst-nodelete.out
: $(objpfx
)tst-nodelete-uniquemod.so \
1428 $(objpfx
)tst-nodelete-rtldmod.so \
1429 $(objpfx
)tst-nodelete-zmod.so
1431 LDFLAGS-tst-nodelete
= -rdynamic
1432 LDFLAGS-tst-nodelete-zmod.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
1434 $(objpfx
)tst-nodelete2
: $(libdl
)
1435 $(objpfx
)tst-nodelete2.out
: $(objpfx
)tst-nodelete2mod.so
1437 LDFLAGS-tst-nodelete2
= -rdynamic
1439 $(objpfx
)tst-initorder-cmp.out
: tst-initorder.exp
$(objpfx
)tst-initorder.out
1443 $(objpfx
)tst-initorder2
: $(objpfx
)tst-initorder2a.so
$(objpfx
)tst-initorder2d.so
$(objpfx
)tst-initorder2c.so
1444 $(objpfx
)tst-initorder2a.so
: $(objpfx
)tst-initorder2b.so
1445 $(objpfx
)tst-initorder2b.so
: $(objpfx
)tst-initorder2c.so
1446 $(objpfx
)tst-initorder2c.so
: $(objpfx
)tst-initorder2d.so
1447 LDFLAGS-tst-initorder2
= -Wl
,--no-as-needed
1448 LDFLAGS-tst-initorder2a.so
= -Wl
,--no-as-needed
1449 LDFLAGS-tst-initorder2b.so
= -Wl
,--no-as-needed
1450 LDFLAGS-tst-initorder2c.so
= -Wl
,--no-as-needed
1451 define o-iterator-doit
1452 $(objpfx
)tst-initorder2
$o.os
: tst-initorder2.c
; \
1453 $$(compile-command.c
) -DNAME
=\"$o\"
1455 object-suffixes-left
:= a b c d
1456 include $(o-iterator
)
1458 $(objpfx
)tst-initorder2-cmp.out
: tst-initorder2.exp
$(objpfx
)tst-initorder2.out
1462 $(objpfx
)tst-relsort1
: $(libdl
)
1463 $(objpfx
)tst-relsort1mod1.so
: $(libm
) $(objpfx
)tst-relsort1mod2.so
1464 $(objpfx
)tst-relsort1mod2.so
: $(libm
)
1465 $(objpfx
)tst-relsort1.out
: $(objpfx
)tst-relsort1mod1.so \
1466 $(objpfx
)tst-relsort1mod2.so
1468 $(objpfx
)tst-unused-dep.out
: $(objpfx
)testobj1.so
1469 $(test-wrapper-env
) \
1470 LD_TRACE_LOADED_OBJECTS
=1 \
1477 $(objpfx
)tst-unused-dep-cmp.out
: $(objpfx
)tst-unused-dep.out
1478 cmp
$< /dev
/null
> $@
; \
1481 $(objpfx
)tst-audit11.out
: $(objpfx
)tst-auditmod11.so
$(objpfx
)tst-audit11mod1.so
1482 $(objpfx
)tst-audit11
: $(libdl
)
1483 tst-audit11-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod11.so
1484 $(objpfx
)tst-audit11mod1.so
: $(objpfx
)tst-audit11mod2.so
1485 LDFLAGS-tst-audit11mod2.so
= -Wl
,--version-script
=tst-audit11mod2.map
,-soname
,tst-audit11mod2.so
1487 $(objpfx
)tst-audit12.out
: $(objpfx
)tst-auditmod12.so
$(objpfx
)tst-audit12mod1.so
$(objpfx
)tst-audit12mod3.so
1488 $(objpfx
)tst-audit12
: $(libdl
)
1489 tst-audit12-ENV
= LD_AUDIT
=$(objpfx
)tst-auditmod12.so
1490 $(objpfx
)tst-audit12mod1.so
: $(objpfx
)tst-audit12mod2.so
1491 LDFLAGS-tst-audit12mod2.so
= -Wl
,--version-script
=tst-audit12mod2.map
1493 $(objpfx
)tst-audit13.out
: $(objpfx
)tst-audit13mod1.so
1494 LDFLAGS-tst-audit13mod1.so
= -Wl
,-z
,lazy
1495 tst-audit13-ENV
= LD_AUDIT
=$(objpfx
)tst-audit13mod1.so
1497 $(objpfx
)tst-auditmany.out
: $(objpfx
)tst-auditmanymod1.so \
1498 $(objpfx
)tst-auditmanymod2.so
$(objpfx
)tst-auditmanymod3.so \
1499 $(objpfx
)tst-auditmanymod4.so
$(objpfx
)tst-auditmanymod5.so \
1500 $(objpfx
)tst-auditmanymod6.so
$(objpfx
)tst-auditmanymod7.so \
1501 $(objpfx
)tst-auditmanymod8.so
$(objpfx
)tst-auditmanymod9.so
1502 tst-auditmany-ENV
= \
1503 LD_AUDIT
=tst-auditmanymod1.so
:tst-auditmanymod2.so
:tst-auditmanymod3.so
:tst-auditmanymod4.so
:tst-auditmanymod5.so
:tst-auditmanymod6.so
:tst-auditmanymod7.so
:tst-auditmanymod8.so
:tst-auditmanymod9.so
1505 LDFLAGS-tst-audit14
= -Wl
,--audit
=tst-auditlogmod-1.so
1506 $(objpfx
)tst-auditlogmod-1.so
: $(libsupport
)
1507 $(objpfx
)tst-audit14.out
: $(objpfx
)tst-auditlogmod-1.so
1508 LDFLAGS-tst-audit15
= \
1509 -Wl
,--audit
=tst-auditlogmod-1.so
,--depaudit
=tst-auditlogmod-2.so
1510 $(objpfx
)tst-auditlogmod-2.so
: $(libsupport
)
1511 $(objpfx
)tst-audit15.out
: \
1512 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so
1513 LDFLAGS-tst-audit16
= \
1514 -Wl
,--audit
=tst-auditlogmod-1.so
:tst-auditlogmod-2.so \
1515 -Wl
,--depaudit
=tst-auditlogmod-3.so
1516 $(objpfx
)tst-auditlogmod-3.so
: $(libsupport
)
1517 $(objpfx
)tst-audit16.out
: \
1518 $(objpfx
)tst-auditlogmod-1.so
$(objpfx
)tst-auditlogmod-2.so \
1519 $(objpfx
)tst-auditlogmod-3.so
1521 # tst-sonamemove links against an older implementation of the library.
1522 LDFLAGS-tst-sonamemove-linkmod1.so
= \
1523 -Wl
,--version-script
=tst-sonamemove-linkmod1.map \
1524 -Wl
,-soname
,tst-sonamemove-runmod1.so
1525 LDFLAGS-tst-sonamemove-runmod1.so
= -Wl
,--no-as-needed \
1526 -Wl
,--version-script
=tst-sonamemove-runmod1.map \
1527 -Wl
,-soname
,tst-sonamemove-runmod1.so
1528 LDFLAGS-tst-sonamemove-runmod2.so
= \
1529 -Wl
,--version-script
=tst-sonamemove-runmod2.map \
1530 -Wl
,-soname
,tst-sonamemove-runmod2.so
1531 $(objpfx
)tst-sonamemove-runmod1.so
: $(objpfx
)tst-sonamemove-runmod2.so
1532 # Link against the link module, but depend on the run-time modules
1534 $(objpfx
)tst-sonamemove-link
: $(objpfx
)tst-sonamemove-linkmod1.so
1535 $(objpfx
)tst-sonamemove-link.out
: \
1536 $(objpfx
)tst-sonamemove-runmod1.so \
1537 $(objpfx
)tst-sonamemove-runmod2.so
1538 $(objpfx
)tst-sonamemove-dlopen
: $(libdl
)
1539 $(objpfx
)tst-sonamemove-dlopen.out
: \
1540 $(objpfx
)tst-sonamemove-runmod1.so \
1541 $(objpfx
)tst-sonamemove-runmod2.so
1543 # Override -z defs, so that we can reference an undefined symbol.
1544 # Force lazy binding for the same reason.
1545 LDFLAGS-tst-latepthreadmod.so
= \
1546 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
1547 # Do not optimize sibling calls as the test relies on a JMP_SLOT relocation for
1548 # function this_function_is_not_defined.
1549 CFLAGS-tst-latepthreadmod.c
+= -fno-optimize-sibling-calls
1550 $(objpfx
)tst-latepthreadmod.so
: $(shared-thread-library
)
1551 $(objpfx
)tst-latepthread
: $(libdl
)
1552 $(objpfx
)tst-latepthread.out
: $(objpfx
)tst-latepthreadmod.so
1554 # The test modules are parameterized by preprocessor macros.
1555 $(patsubst %,$(objpfx
)%.os
,$(tst-tls-many-dynamic-modules
)): \
1556 $(objpfx
)tst-tls-manydynamic
%mod.os
: tst-tls-manydynamicmod.c
1557 $(compile-command.c
) \
1558 -DNAME
=tls_global_
$* -DSETTER
=set_value_
$* -DGETTER
=get_value_
$*
1559 $(objpfx
)tst-tls-manydynamic
: $(libdl
) $(shared-thread-library
)
1560 $(objpfx
)tst-tls-manydynamic.out
: \
1561 $(patsubst %,$(objpfx
)%.so
,$(tst-tls-many-dynamic-modules
))
1563 tst-prelink-ENV
= LD_TRACE_PRELINKING
=1
1565 $(objpfx
)tst-prelink-conflict.out
: $(objpfx
)tst-prelink.out
1566 grep stdout
$< | grep conflict |
$(AWK
) '{ print $$10, $$11 }' > $@
1568 $(objpfx
)tst-prelink-cmp.out
: tst-prelink.exp \
1569 $(objpfx
)tst-prelink-conflict.out
1573 $(objpfx
)tst-ldconfig-X.out
: tst-ldconfig-X.sh
$(objpfx
)ldconfig
1574 $(SHELL
) $< '$(common-objpfx)' '$(test-wrapper-env)' \
1575 '$(run-program-env)' > $@
; \
1578 $(objpfx
)tst-dlsym-error
: $(libdl
)
1580 # Test static linking of all the libraries we can possibly link
1581 # together. Note that in some configurations this may be less than the
1582 # complete list of libraries we build but we try to maxmimize this list.
1583 $(objpfx
)tst-linkall-static
: \
1584 $(common-objpfx
)math
/libm.a \
1585 $(common-objpfx
)resolv
/libresolv.a \
1586 $(common-objpfx
)dlfcn
/libdl.a \
1587 $(common-objpfx
)login
/libutil.a \
1588 $(common-objpfx
)rt
/librt.a \
1589 $(common-objpfx
)resolv
/libanl.a \
1590 $(static-thread-library
)
1592 ifeq ($(build-crypt
),yes
)
1593 # If we are using NSS crypto and we have the ability to link statically
1594 # then we include libcrypt.a, otherwise we leave out libcrypt.a and
1595 # link as much as we can into the tst-linkall-static test. This assumes
1596 # that linking with libcrypt.a does everything required to include the
1597 # static NSS crypto library.
1598 ifeq (yesyes
,$(nss-crypt
)$(static-nss-crypt
))
1599 $(objpfx
)tst-linkall-static
: \
1600 $(common-objpfx
)crypt
/libcrypt.a
1602 # If we are not using NSS crypto then we always have the ability to link
1604 ifeq (no
,$(nss-crypt
))
1605 $(objpfx
)tst-linkall-static
: \
1606 $(common-objpfx
)crypt
/libcrypt.a
1610 # The application depends on the DSO, and the DSO loads the plugin.
1611 # The plugin also depends on the DSO. This creates the circular
1612 # dependency via dlopen that we're testing to make sure works.
1613 $(objpfx
)tst-nodelete-dlclose-dso.so
: $(libdl
)
1614 $(objpfx
)tst-nodelete-dlclose-plugin.so
: $(objpfx
)tst-nodelete-dlclose-dso.so
1615 $(objpfx
)tst-nodelete-dlclose
: $(objpfx
)tst-nodelete-dlclose-dso.so
1616 $(objpfx
)tst-nodelete-dlclose.out
: $(objpfx
)tst-nodelete-dlclose-dso.so \
1617 $(objpfx
)tst-nodelete-dlclose-plugin.so
1619 tst-env-setuid-ENV
= MALLOC_CHECK_
=2 MALLOC_MMAP_THRESHOLD_
=4096 \
1621 tst-env-setuid-tunables-ENV
= \
1622 GLIBC_TUNABLES
=glibc.malloc.
check=2:glibc.malloc.mmap_threshold
=4096
1624 $(objpfx
)tst-debug1
: $(libdl
)
1625 $(objpfx
)tst-debug1.out
: $(objpfx
)tst-debug1mod1.so
1627 $(objpfx
)tst-debug1mod1.so
: $(objpfx
)testobj1.so
1628 $(OBJCOPY
) --only-keep-debug
$< $@
1630 $(objpfx
)tst-main1
: $(objpfx
)tst-main1mod.so
1631 CRT-tst-main1
:= $(csu-objpfx
)crt1.o
1632 tst-main1-no-pie
= yes
1633 LDLIBS-tst-main1
= $(libsupport
)
1634 tst-main1mod.so-no-z-defs
= yes
1636 LDLIBS-tst-absolute-sym-lib.so
= tst-absolute-sym-lib.lds
1637 $(objpfx
)tst-absolute-sym-lib.so
: $(LDLIBS-tst-absolute-sym-lib.so
)
1638 $(objpfx
)tst-absolute-sym
: $(objpfx
)tst-absolute-sym-lib.so
1640 LDLIBS-tst-absolute-zero-lib.so
= tst-absolute-zero-lib.lds
1641 $(objpfx
)tst-absolute-zero-lib.so
: $(LDLIBS-tst-absolute-zero-lib.so
)
1642 $(objpfx
)tst-absolute-zero
: $(objpfx
)tst-absolute-zero-lib.so
1644 # Both the main program and the DSO for tst-libc_dlvsym need to link
1646 $(objpfx
)tst-libc_dlvsym
: $(libdl
)
1647 $(objpfx
)tst-libc_dlvsym-dso.so
: $(libsupport
) $(libdl
)
1648 $(objpfx
)tst-libc_dlvsym.out
: $(objpfx
)tst-libc_dlvsym-dso.so
1649 $(objpfx
)tst-libc_dlvsym-static
: $(common-objpfx
)dlfcn
/libdl.a
1650 tst-libc_dlvsym-static-ENV
= \
1651 LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
):$(common-objpfx
)dlfcn
1652 $(objpfx
)tst-libc_dlvsym-static.out
: $(objpfx
)tst-libc_dlvsym-dso.so
1654 $(objpfx
)tst-big-note
: $(objpfx
)tst-big-note-lib.so
1655 # Avoid creating an ABI tag note, which may come before the
1656 # artificial, large note in tst-big-note-lib.o and invalidate the
1658 $(objpfx
)tst-big-note-lib.so
: $(objpfx
)tst-big-note-lib.o
1659 $(LINK.o
) -shared
-o
$@
$(LDFLAGS.so
) $<
1661 $(objpfx
)tst-unwind-ctor
: $(objpfx
)tst-unwind-ctor-lib.so
1663 CFLAGS-tst-unwind-main.c
+= -funwind-tables
-DUSE_PTHREADS
=0
1665 $(objpfx
)tst-initfinilazyfail
: $(libdl
)
1666 $(objpfx
)tst-initfinilazyfail.out
: \
1667 $(objpfx
)tst-initlazyfailmod.so
$(objpfx
)tst-finilazyfailmod.so
1668 # Override -z defs, so that we can reference an undefined symbol.
1669 # Force lazy binding for the same reason.
1670 LDFLAGS-tst-initlazyfailmod.so
= \
1671 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
1672 LDFLAGS-tst-finilazyfailmod.so
= \
1673 -Wl
,-z
,lazy
-Wl
,--unresolved-symbols
=ignore-all
1675 $(objpfx
)tst-dlopenfail
: $(libdl
)
1676 $(objpfx
)tst-dlopenfail.out
: \
1677 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so
1678 # Order matters here. tst-dlopenfaillinkmod.so's soname ensures a
1679 # run-time loader failure. --as-needed breaks this test because
1680 # nothing actually references tst-dlopenfailmod2.so (with its soname
1681 # tst-dlopenfail-missingmod.so).
1682 LDFLAGS-tst-dlopenfailmod1.so
= -Wl
,--no-as-needed
1683 $(objpfx
)tst-dlopenfailmod1.so
: \
1684 $(shared-thread-library
) $(objpfx
)tst-dlopenfaillinkmod.so
1685 LDFLAGS-tst-dlopenfaillinkmod.so
= -Wl
,-soname
,tst-dlopenfail-missingmod.so
1686 $(objpfx
)tst-dlopenfailmod2.so
: $(shared-thread-library
)
1687 $(objpfx
)tst-dlopenfail-2
: $(libdl
)
1688 $(objpfx
)tst-dlopenfail.out
: \
1689 $(objpfx
)tst-dlopenfailmod1.so
$(objpfx
)tst-dlopenfailmod2.so \
1690 $(objpfx
)tst-dlopenfailmod3.so
1692 $(objpfx
)tst-dlopen-nodelete-reloc
: $(libdl
)
1693 $(objpfx
)tst-dlopen-nodelete-reloc.out
: \
1694 $(objpfx
)tst-dlopen-nodelete-reloc-mod1.so \
1695 $(objpfx
)tst-dlopen-nodelete-reloc-mod2.so \
1696 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so \
1697 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so \
1698 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so \
1699 $(objpfx
)tst-dlopen-nodelete-reloc-mod6.so \
1700 $(objpfx
)tst-dlopen-nodelete-reloc-mod7.so \
1701 $(objpfx
)tst-dlopen-nodelete-reloc-mod8.so \
1702 $(objpfx
)tst-dlopen-nodelete-reloc-mod9.so \
1703 $(objpfx
)tst-dlopen-nodelete-reloc-mod10.so \
1704 $(objpfx
)tst-dlopen-nodelete-reloc-mod11.so \
1705 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so \
1706 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so \
1707 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so \
1708 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
1709 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so \
1710 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
1711 tst-dlopen-nodelete-reloc-mod2.so-no-z-defs
= yes
1712 LDFLAGS-tst-dlopen-nodelete-reloc-mod2.so
= -Wl
,-z
,nodelete
1713 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
: \
1714 $(objpfx
)tst-dlopen-nodelete-reloc-mod3.so
1715 LDFLAGS-tst-dlopen-nodelete-reloc-mod4.so
= -Wl
,--no-as-needed
1716 $(objpfx
)tst-dlopen-nodelete-reloc-mod5.so
: \
1717 $(objpfx
)tst-dlopen-nodelete-reloc-mod4.so
1718 LDFLAGS-tst-dlopen-nodelete-reloc-mod5.so
= -Wl
,-z
,nodelete
,--no-as-needed
1719 tst-dlopen-nodelete-reloc-mod5.so-no-z-defs
= yes
1720 tst-dlopen-nodelete-reloc-mod7.so-no-z-defs
= yes
1721 $(objpfx
)tst-dlopen-nodelete-reloc-mod8.so
: $(libdl
)
1722 $(objpfx
)tst-dlopen-nodelete-reloc-mod10.so
: $(libdl
)
1723 tst-dlopen-nodelete-reloc-mod11.so-no-z-defs
= yes
1724 $(objpfx
)tst-dlopen-nodelete-reloc-mod13.so
: \
1725 $(objpfx
)tst-dlopen-nodelete-reloc-mod12.so
1726 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
: \
1727 $(objpfx
)tst-dlopen-nodelete-reloc-mod14.so
1728 tst-dlopen-nodelete-reloc-mod16.so-no-z-defs
= yes
1729 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
: \
1730 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so
1731 LDFLAGS-tst-dlopen-nodelete-reloc-mod16.so
= -Wl
,--no-as-needed
1732 $(objpfx
)tst-dlopen-nodelete-reloc-mod17.so
: \
1733 $(objpfx
)tst-dlopen-nodelete-reloc-mod15.so \
1734 $(objpfx
)tst-dlopen-nodelete-reloc-mod16.so
1735 LDFLAGS-tst-dlopen-nodelete-reloc-mod17.so
= -Wl
,--no-as-needed
1737 $(objpfx
)tst-ldconfig-ld_so_conf-update.out
: $(objpfx
)tst-ldconfig-ld-mod.so
1738 $(objpfx
)tst-ldconfig-ld_so_conf-update
: $(libdl
)
1740 LDFLAGS-tst-filterobj-flt.so
= -Wl
,--filter=$(objpfx
)tst-filterobj-filtee.so
1741 $(objpfx
)tst-filterobj
: $(objpfx
)tst-filterobj-flt.so
1742 $(objpfx
)tst-filterobj-dlopen
: $(libdl
)
1743 $(objpfx
)tst-filterobj.out
: $(objpfx
)tst-filterobj-filtee.so
1744 $(objpfx
)tst-filterobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so
1746 LDFLAGS-tst-filterobj-aux.so
= -Wl
,--auxiliary
=$(objpfx
)tst-filterobj-filtee.so
1747 $(objpfx
)tst-auxobj
: $(objpfx
)tst-filterobj-aux.so
1748 $(objpfx
)tst-auxobj-dlopen
: $(libdl
)
1749 $(objpfx
)tst-auxobj.out
: $(objpfx
)tst-filterobj-filtee.so
1750 $(objpfx
)tst-auxobj-dlopen.out
: $(objpfx
)tst-filterobj-filtee.so