1 # Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, write to the Free
16 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 # Makefile for elf subdirectory of GNU C Library.
23 headers
= elf.h bits
/elfclass.h link.h
24 routines
= $(dl-routines
) dl-open dl-close dl-support dl-iteratephdr \
25 dl-iteratephdr-static dl-addr enbl-secure dl-profstub \
26 dl-origin dl-libc dl-sym dl-tsd
28 # The core dynamic linking functions are in libc for the static and
30 dl-routines
= $(addprefix dl-
,load cache lookup object reloc deps \
31 runtime error init fini debug misc \
32 version profile conflict tls
origin)
33 all-dl-routines
= $(dl-routines
) $(sysdep-dl-routines
)
34 # But they are absent from the shared libc, because that code is in ld.so.
35 elide-routines.os
= $(all-dl-routines
) dl-support enbl-secure \
36 dl-iteratephdr-static dl-origin
38 # ld.so uses those routines, plus some special stuff for being the program
39 # interpreter and operating independent of libc.
40 rtld-routines
:= rtld
$(dl-routines
) dl-sysdep dl-environ dl-minimal
41 all-rtld-routines
= $(rtld-routines
) $(sysdep-rtld-routines
)
43 distribute
:= rtld-Rules \
44 $(rtld-routines
:=.c
) dynamic-link.h do-rel.h dl-machine.h \
45 dl-cache.h dl-hash.h soinit.c sofini.c ldd.bash.in \
46 genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \
47 dl-librecon.h interp.c sln.c dl-dst.h hp-timing.h \
48 do-lookup.h dl-lookupcfg.h sprof.c gen-trusted-dirs.awk \
49 testobj1.c testobj2.c testobj3.c testobj4.c testobj5.c \
50 testobj6.c testobj1_1.c failobj.c unloadmod.c \
51 ldconfig.h ldconfig.c cache.c readlib.c readelflib.c \
52 chroot_canon.c gccframe.h \
53 dep1.c dep2.c dep3.c dep4.c dl-dtprocnum.h unsecvars.h \
54 vismain.c vismod1.c vismod2.c vismod3.c \
55 constload2.c constload3.c filtmod1.c filtmod2.c \
56 nodlopenmod.c nodelete.c nodelmod1.c nodelmod2.c \
57 nodelmod3.c nodelmod4.c nodlopen.c dl-osinfo.h \
58 reldepmod1.c reldepmod2.c reldepmod3.c reldepmod4.c \
59 reldepmod5.c reldepmod6.c \
60 reldep4mod1.c reldep4mod2.c reldep4mod3.c reldep4mod4.c \
61 nextmod1.c nextmod2.c pathoptobj.c tst-pathopt.sh \
62 neededobj1.c neededobj2.c neededobj3.c neededobj4.c \
63 neededobj5.c neededobj6.c firstobj.c \
64 unload2mod.c unload2dep.c ltglobmod1.c ltglobmod2.c \
65 testobj.h vismod.h globalmod1.c \
66 dblloadmod1.c dblloadmod2.c dblloadmod3.c \
67 reldep6mod4.c reldep6mod3.c reldep6mod2.c reldep6mod1.c \
68 reldep6mod0.c reldep7mod1.c reldep7mod2.c \
69 unwind-dw2.c unwind-dw2-fde.c unwind.h unwind-pe.h \
70 unwind-dw2-fde.h dwarf2.h dl-procinfo.c tls.h dl-tls.h \
71 tst-tlsmod1.c tst-tlsmod2.c tst-tlsmod3.c tst-tlsmod4.c \
72 tst-tlsmod5.c tst-tlsmod6.c tst-tlsmod7.c tst-tlsmod8.c \
73 tst-tlsmod9.c tst-tlsmod10.c tst-tlsmod11.c \
74 tst-tlsmod12.c tst-tls10.h \
75 circlemod1.c circlemod1a.c circlemod2.c circlemod2a.c \
76 circlemod3.c circlemod3a.c nodlopenmod2.c \
78 reldep8mod1.c reldep8mod2.c reldep8mod3.c \
79 nodel2mod1.c nodel2mod2.c nodel2mod3.c \
80 reldep9.c reldep9mod1.c reldep9mod2.c reldep9mod3.c \
81 tst-array1.exp tst-array2.exp tst-array4.exp \
83 check-textrel.c dl-sysdep.h
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 ($(versioning
),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_slibdir
)/$(rtld-installed-name
)
104 install-bin-script
= ldd
110 install-rootsbin
= sln
112 ifeq (yes
,$(use-ldconfig
))
113 ifeq (yes
,$(build-shared
))
114 others-static
+= ldconfig
116 install-rootsbin
+= ldconfig
118 ldconfig-modules
:= cache readlib xmalloc xstrdup chroot_canon
119 extra-objs
+= $(ldconfig-modules
:=.o
)
121 # To find xmalloc.c and xstrdup.c
122 vpath
%.c ..
/locale
/programs
127 tests
= tst-tls1 tst-tls2 tst-tls9
128 ifeq (yes
,$(have-initfini-array
))
129 tests
+= tst-array1 tst-array2 tst-array3 tst-array4
131 ifeq (yes
,$(build-static
))
132 tests-static
= tst-tls1-static tst-tls2-static
133 ifeq (yesyesyes
,$(build-static
)$(build-shared
)$(elf
))
134 tests-static
+= tst-tls9-static
135 tst-tls9-static-ENV
= \
136 LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
):$(common-objpfx
)dlfcn
138 tests
+= $(tests-static
)
140 ifeq (yes
,$(build-shared
))
141 tests
+= loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
142 constload1 order
$(tests-vis-
$(have-protected
)) noload
filter unload \
143 reldep reldep2 reldep3 reldep4
$(tests-nodelete-
$(have-z-nodelete
)) \
144 $(tests-nodlopen-
$(have-z-nodlopen
)) neededtest neededtest2 \
145 neededtest3 neededtest4 unload2 lateglobal initfirst global \
146 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
147 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
148 tst-tls10 tst-tls11 tst-tls12
150 test-srcs
= tst-pathopt
151 tests-vis-yes
= vismain
152 tests-nodelete-yes
= nodelete nodelete2
153 tests-nodlopen-yes
= nodlopen nodlopen2
155 modules-names
= testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
156 testobj1_1 failobj constload2 constload3 unloadmod \
157 dep1 dep2 dep3 dep4
$(modules-vis-
$(have-protected
)) \
158 $(modules-nodelete-
$(have-z-nodelete
)) \
159 $(modules-nodlopen-
$(have-z-nodlopen
)) filtmod1 filtmod2 \
160 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
161 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
162 neededobj1 neededobj2 neededobj3 neededobj4 \
163 neededobj5 neededobj6 firstobj globalmod1 \
164 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \
165 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \
166 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \
167 reldep7mod1 reldep7mod2 \
168 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \
169 tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
170 tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
171 circlemod1 circlemod1a circlemod2 circlemod2a \
172 circlemod3 circlemod3a \
173 reldep8mod1 reldep8mod2 reldep8mod3 \
174 reldep9mod1 reldep9mod2 reldep9mod3
175 ifeq (yes
,$(have-initfini-array
))
176 modules-names
+= tst-array2dep
178 modules-vis-yes
= vismod1 vismod2 vismod3
179 modules-nodelete-yes
= nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
180 nodel2mod1 nodel2mod2 nodel2mod3
181 modules-nodlopen-yes
= nodlopenmod nodlopenmod2
182 extra-objs
+= $(addsuffix .os
,$(strip $(modules-names
)))
183 # We need this variable to be sure the test modules get the right CPPFLAGS.
184 test-extras
+= $(modules-names
)
188 check-abi
: check-abi-ld
189 update-abi
: update-abi-ld
191 ifeq (yes
,$(build-shared
))
192 # Make sure these things are built in the `make lib' pass so they can be used
193 # to run programs during the `make others' pass.
194 lib-noranlib
: $(objpfx
)$(rtld-installed-name
) \
195 $(addprefix $(objpfx
),$(extra-objs
))
198 # Command to link into a larger single relocatable object.
199 reloc-link
= $(LINK.o
) -nostdlib
-nostartfiles
-r
201 $(objpfx
)dl-allobjs.os
: $(all-rtld-routines
:%=$(objpfx
)%.os
)
202 $(reloc-link
) -o
$@
$^
204 # Link together the dynamic linker into a single relocatable object.
205 # First we do a link against libc_pic.a just to get a link map,
206 # and discard the object produced by that link. From the link map
207 # we can glean all the libc modules that need to go into the dynamic
208 # linker. Then we do a recursive make that goes into all the subdirs
209 # those modules come from and builds special rtld-foo.os versions that
210 # are compiled with special flags, and puts these modules into rtld-libc.a
211 # for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
213 $(objpfx
)librtld.map
: $(objpfx
)dl-allobjs.os
$(common-objpfx
)libc_pic.a
215 $(reloc-link
) -o
$@.o
'-Wl,-(' $^
-lgcc
'-Wl,-)' -Wl
,-Map
,$@T
219 $(objpfx
)librtld.mk
: $(objpfx
)librtld.map Makefile
220 sed
-n
's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \
222 while read lib file
; do \
226 $(common-objpfx
)stamp.os
$(common-objpfx
)*/stamp.os | \
227 sed
's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
230 echo rtld-
$${lib
%%/*} += $$file ;; \
231 *) echo
"Wasn't expecting $$lib($$file)" >&2; exit
1 ;; \
234 echo rtld-subdirs
= `sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
238 $(objpfx
)rtld-libc.a
: $(objpfx
)librtld.mk FORCE
239 $(MAKE
) -f
$< -f rtld-Rules
241 generated
+= librtld.map librtld.mk rtld-libc.a
243 $(objpfx
)librtld.os
: $(objpfx
)dl-allobjs.os
$(objpfx
)rtld-libc.a
244 $(LINK.o
) -nostdlib
-nostartfiles
-r
-o
$@
'-Wl,-(' $^
-lgcc
'-Wl,-)'
246 $(objpfx
)ld.so
: $(objpfx
)librtld.os
$(ld-map
)
248 $(LINK.o
) -nostdlib
-nostartfiles
-shared \
249 $(LDFLAGS-rtld
) -Wl
,-z
,defs
-Wl
,--verbose
2>&1 | \
250 sed
-e
'/^=========/,/^=========/!d;/^=========/d' \
251 -e
's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
253 $(LINK.o
) -nostdlib
-nostartfiles
-shared
-o
$@ \
254 $(LDFLAGS-rtld
) -Wl
,-z
,defs \
255 $(filter-out $(map-file
),$^
) $(load-map-file
) \
256 -Wl
,-soname
=$(rtld-installed-name
) -T
$@.lds
259 # interp.c exists just to get this string into the libraries.
260 CFLAGS-interp.c
= -D
'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"'
261 $(objpfx
)interp.os
: $(common-objpfx
)config.make
263 ifneq (ld.so
,$(rtld-installed-name
))
264 # Make sure ld.so.1 exists in the build directory so we can link
266 $(objpfx
)$(rtld-installed-name
): $(objpfx
)ld.so
269 generated
+= $(rtld-installed-name
)
272 # Build a file mentioning all trustworthy directories to look for shared
273 # libraries when using LD_LIBRARY_PATH in a setuid program. The user can
274 # add directories to the list by defining $(user-defined-trusted-dirs)
275 # before starting make.
276 $(objpfx
)trusted-dirs.h
: $(objpfx
)trusted-dirs.st
; @
:
277 $(objpfx
)trusted-dirs.st
: Makefile
$(..
)Makeconfig
278 $(make-target-directory
)
279 echo
"$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
280 |
$(AWK
) -f gen-trusted-dirs.awk
> ${@
:st
=T
};
281 echo
'#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@
:st
=T
}
282 $(move-if-change
) ${@
:st
=T
} ${@
:st
=h
}
284 CPPFLAGS-dl-load.c
= -I
$(objpfx
).
-I
$(csu-objpfx
).
286 ifeq (yes
,$(build-shared
))
287 $(inst_slibdir
)/$(rtld-version-installed-name
): $(objpfx
)ld.so
$(+force)
288 $(make-target-directory
)
289 $(do-install-program
)
291 $(inst_slibdir
)/$(rtld-installed-name
): \
292 $(inst_slibdir
)/$(rtld-version-installed-name
) \
293 $(inst_slibdir
)/libc-
$(version
).so
296 # Special target called by parent to install just the dynamic linker.
298 ldso_install
: $(inst_slibdir
)/$(rtld-installed-name
)
302 common-ldd-rewrite
= -e
's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
303 -e
's%@VERSION@%$(version)%g'
304 sh-ldd-rewrite
= $(common-ldd-rewrite
) -e
's%@BASH@%/bin/sh%g;s/\$$"/"/g'
305 bash-ldd-rewrite
= $(common-ldd-rewrite
) -e
's%@BASH@%$(BASH)%g' \
306 -e
's%@TEXTDOMAINDIR@%$(msgcatdir)%g'
308 ifneq ($(have-bash2
),yes
)
314 ifeq ($(ldd-rewrite-script
),no
)
316 sed
$($(ldd-shell
)-ldd-rewrite
) < $< > $@.new
320 sed
$($(ldd-shell
)-ldd-rewrite
) < $< | sed
-f
$(ldd-rewrite-script
) > $@.new
324 $(objpfx
)ldd
: ldd.bash.in
$(common-objpfx
)soversions.mk \
325 $(common-objpfx
)config.make
330 $(objpfx
)sprof
: $(libdl
)
332 $(objpfx
)ldconfig
: $(ldconfig-modules
:%=$(objpfx
)%.o
)
333 SYSCONF-FLAGS
:= -D
'SYSCONFDIR="$(sysconfdir)"'
334 CFLAGS-ldconfig.c
= $(SYSCONF-FLAGS
) -D
'LIBDIR="$(libdir)"' -D
'SLIBDIR="$(slibdir)"'
335 CFLAGS-dl-cache.c
= $(SYSCONF-FLAGS
)
336 CFLAGS-cache.c
= $(SYSCONF-FLAGS
)
338 CPPFLAGS-.os
+= $(if
$(filter $(@F
),$(patsubst %,%.os
,$(all-rtld-routines
))),-DNOT_IN_libc
=1 -DIS_IN_rtld
=1)
340 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(strip $(modules-names
))))
341 generated
+= $(addsuffix .so
,$(strip $(modules-names
)))
343 ifeq (yes
,$(build-shared
))
344 ifeq ($(cross-compiling
),no
)
345 tests
: $(objpfx
)tst-pathopt.out
349 $(objpfx
)testobj1.so
: $(libdl
)
350 $(objpfx
)testobj1_1.so
: $(objpfx
)testobj1.so
$(libdl
)
351 $(objpfx
)testobj2.so
: $(objpfx
)testobj1.so
$(libdl
)
352 $(objpfx
)testobj3.so
: $(libdl
)
353 $(objpfx
)testobj4.so
: $(libdl
)
354 $(objpfx
)testobj5.so
: $(libdl
)
355 $(objpfx
)testobj6.so
: $(objpfx
)testobj1.so
$(objpfx
)testobj2.so
$(libdl
)
356 $(objpfx
)failobj.so
: $(objpfx
)testobj6.so
357 $(objpfx
)dep1.so
: $(objpfx
)dep2.so
$(objpfx
)dep4.so
358 $(objpfx
)dep2.so
: $(objpfx
)dep3.so
$(objpfx
)dep4.so
359 $(objpfx
)dep4.so
: $(objpfx
)dep3.so
360 $(objpfx
)nodelmod3.so
: $(objpfx
)nodelmod4.so
361 $(objpfx
)nextmod1.so
: $(libdl
)
362 $(objpfx
)neededobj1.so
: $(libdl
)
363 $(objpfx
)neededobj2.so
: $(objpfx
)neededobj1.so
$(libdl
)
364 $(objpfx
)neededobj3.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so
$(libdl
)
365 $(objpfx
)neededobj4.so
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
366 $(objpfx
)neededobj3.so
$(libdl
)
367 $(objpfx
)neededobj6.so
: $(objpfx
)neededobj5.so
368 $(objpfx
)unload2mod.so
: $(objpfx
)unload2dep.so
369 $(objpfx
)ltglobmod2.so
: $(libdl
)
370 $(objpfx
)firstobj.so
: $(shared-thread-library
)
371 $(objpfx
)globalmod1.so
: $(libdl
)
372 $(objpfx
)reldep4mod1.so
: $(objpfx
)reldep4mod3.so
373 $(objpfx
)reldep4mod2.so
: $(objpfx
)reldep4mod4.so
374 $(objpfx
)dblloadmod1.so
: $(objpfx
)dblloadmod3.so
375 $(objpfx
)dblloadmod2.so
: $(objpfx
)dblloadmod3.so
376 $(objpfx
)reldepmod5.so
: $(objpfx
)reldepmod2.so
377 $(objpfx
)reldepmod6.so
: $(objpfx
)reldepmod2.so
378 $(objpfx
)reldep6mod1.so
: $(objpfx
)reldep6mod0.so
379 $(objpfx
)reldep6mod2.so
: $(objpfx
)reldep6mod1.so
380 $(objpfx
)reldep6mod3.so
: $(objpfx
)reldep6mod2.so
381 $(objpfx
)reldep6mod4.so
: $(objpfx
)reldep6mod1.so
382 $(objpfx
)tst-tlsmod3.so
: $(objpfx
)tst-tlsmod2.so
383 $(objpfx
)tst-tlsmod8.so
: $(objpfx
)tst-tlsmod7.so
384 $(objpfx
)tst-tlsmod10.so
: $(objpfx
)tst-tlsmod9.so
385 $(objpfx
)tst-tlsmod12.so
: $(objpfx
)tst-tlsmod11.so
386 # For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
387 $(objpfx
)tst-tlsmod5.so
: $(common-objpfx
)libc.so
388 $(objpfx
)tst-tlsmod6.so
: $(common-objpfx
)libc.so
389 $(objpfx
)reldep8mod3.so
: $(objpfx
)reldep8mod1.so
$(objpfx
)reldep8mod2.so
390 $(objpfx
)nodel2mod3.so
: $(objpfx
)nodel2mod1.so
$(objpfx
)nodel2mod2.so
391 $(objpfx
)reldep9mod2.so
: $(objpfx
)reldep9mod1.so
392 $(objpfx
)reldep9mod3.so
: $(objpfx
)reldep9mod1.so
$(objpfx
)reldep9mod2.so
394 LDFLAGS-tst-tlsmod5.so
= -nostdlib
395 LDFLAGS-tst-tlsmod6.so
= -nostdlib
397 # filtmod1.so has a special rule
398 $(filter-out $(objpfx
)filtmod1.so
, $(test-modules
)): $(objpfx
)%.so
: $(objpfx
)%.os
401 $(objpfx
)loadtest
: $(libdl
)
402 LDFLAGS-loadtest
= -rdynamic
404 $(objpfx
)loadtest.out
: $(test-modules
)
406 $(objpfx
)neededtest
: $(libdl
)
407 $(objpfx
)neededtest.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
408 $(objpfx
)neededobj3.so
410 $(objpfx
)neededtest2
: $(libdl
)
411 $(objpfx
)neededtest2.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
412 $(objpfx
)neededobj3.so
414 $(objpfx
)neededtest3
: $(libdl
)
415 $(objpfx
)neededtest3.out
: $(objpfx
)neededobj1.so
$(objpfx
)neededobj2.so \
416 $(objpfx
)neededobj3.so
$(objpfx
)neededobj4.so
418 neededtest4-ENV
= LC_ALL
=C LANGUAGE
=C
419 $(objpfx
)neededtest4
: $(libdl
) $(objpfx
)neededobj1.so
420 $(objpfx
)neededtest4.out
: $(objpfx
)neededobj5.so
$(objpfx
)neededobj6.so
422 $(objpfx
)restest1
: $(objpfx
)testobj1.so
$(objpfx
)testobj1_1.so
$(libdl
)
423 LDFLAGS-restest1
= -rdynamic
425 $(objpfx
)restest2
: $(libdl
)
426 LDFLAGS-restest2
= -rdynamic
428 $(objpfx
)restest1.out
: $(test-modules
)
430 preloadtest-preloads
= testobj1 testobj2 testobj3 testobj4 testobj5
431 $(objpfx
)preloadtest
: $(objpfx
)testobj6.so
432 LDFLAGS-preloadtest
= -rdynamic
433 $(objpfx
)preloadtest.out
: $(preloadtest-preloads
:%=$(objpfx
)%.so
)
435 LD_PRELOAD
=$(subst $(empty
) ,:,$(strip $(preloadtest-preloads
:=.so
)))
437 $(objpfx
)loadfail
: $(libdl
)
438 LDFLAGS-loadfail
= -rdynamic
440 $(objpfx
)loadfail.out
: $(objpfx
)failobj.so
442 $(objpfx
)multiload
: $(libdl
)
443 LDFLAGS-multiload
= -rdynamic
444 CFLAGS-multiload.c
= -DOBJDIR
=\"$(elf-objpfx
)\"
446 $(objpfx
)multiload.out
: $(objpfx
)testobj1.so
448 $(objpfx
)origtest
: $(libdl
)
449 LDFLAGS-origtest
= -rdynamic
450 $(objpfx
)origtest.out
: $(objpfx
)testobj1.so
452 ifeq ($(have-thread-library
),yes
)
453 $(objpfx
)resolvfail
: $(libdl
) $(shared-thread-library
)
455 $(objpfx
)resolvfail
: $(libdl
)
458 $(objpfx
)constload1
: $(libdl
)
459 $(objpfx
)constload1.out
: $(objpfx
)constload2.so
$(objpfx
)constload3.so
461 $(objpfx
)circleload1
: $(libdl
)
462 $(objpfx
)circleload1.out
: $(objpfx
)circlemod1.so \
463 $(objpfx
)circlemod1a.so
465 $(objpfx
)circlemod1.so
: $(objpfx
)circlemod2.so
466 $(objpfx
)circlemod2.so
: $(objpfx
)circlemod3.so
467 $(objpfx
)circlemod1a.so
: $(objpfx
)circlemod2a.so
468 $(objpfx
)circlemod2a.so
: $(objpfx
)circlemod3a.so
470 $(objpfx
)order
: $(addprefix $(objpfx
),dep4.so dep3.so dep2.so dep1.so
)
472 $(objpfx
)order.out
: $(objpfx
)order
473 $(elf-objpfx
)$(rtld-installed-name
) \
474 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
476 (echo
"0123456789" | cmp
$@
-) > /dev
/null
478 $(objpfx
)vismain
: $(addprefix $(objpfx
),vismod1.so vismod2.so
)
479 $(objpfx
)vismain.out
: $(addprefix $(objpfx
),vismod3.so
)
480 vismain-ENV
= LD_PRELOAD
=$(addprefix $(objpfx
),vismod3.so
)
482 $(objpfx
)noload
: $(objpfx
)testobj1.so
483 LDFLAGS-noload
= -rdynamic
484 $(objpfx
)noload.out
: $(objpfx
)testobj5.so
486 LDFLAGS-nodelete
= -rdynamic
487 LDFLAGS-nodelmod1.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
488 LDFLAGS-nodelmod4.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
489 $(objpfx
)nodelete
: $(libdl
)
490 $(objpfx
)nodelete.out
: $(objpfx
)nodelmod1.so
$(objpfx
)nodelmod2.so \
491 $(objpfx
)nodelmod3.so
493 LDFLAGS-nodlopenmod.so
= -Wl
,--enable-new-dtags
,-z
,nodlopen
494 $(objpfx
)nodlopen
: $(libdl
)
495 $(objpfx
)nodlopen.out
: $(objpfx
)nodlopenmod.so
497 $(objpfx
)nodlopenmod2.so
: $(objpfx
)nodlopenmod.so
498 $(objpfx
)nodlopen2
: $(libdl
)
499 $(objpfx
)nodlopen2.out
: $(objpfx
)nodlopenmod2.so
501 $(objpfx
)filtmod1.so
: $(objpfx
)filtmod1.os
$(objpfx
)filtmod2.so
502 $(LINK.o
) -shared
-o
$@
-B
$(csu-objpfx
) $(LDFLAGS.so
) \
503 -L
$(subst :, -L
,$(rpath-link
)) \
504 -Wl
,-rpath-link
=$(rpath-link
) \
505 $< -Wl
,-F
,$(objpfx
)filtmod2.so
506 $(objpfx
)filter: $(objpfx
)filtmod1.so
508 $(objpfx
)unload
: $(libdl
)
509 $(objpfx
)unload.out
: $(objpfx
)unloadmod.so
511 $(objpfx
)reldep
: $(libdl
)
512 $(objpfx
)reldep.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod2.so
514 $(objpfx
)reldep2
: $(libdl
)
515 $(objpfx
)reldep2.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod3.so
517 $(objpfx
)reldep3
: $(libdl
)
518 $(objpfx
)reldep3.out
: $(objpfx
)reldepmod1.so
$(objpfx
)reldepmod4.so
520 $(objpfx
)reldep4
: $(libdl
)
521 $(objpfx
)reldep4.out
: $(objpfx
)reldep4mod1.so
$(objpfx
)reldep4mod2.so
523 $(objpfx
)next
: $(objpfx
)nextmod1.so
$(objpfx
)nextmod2.so
$(libdl
)
525 $(objpfx
)unload2
: $(libdl
)
526 $(objpfx
)unload2.out
: $(objpfx
)unload2mod.so
$(objpfx
)unload2dep.so
528 $(objpfx
)lateglobal
: $(libdl
)
529 $(objpfx
)lateglobal.out
: $(objpfx
)ltglobmod1.so
$(objpfx
)ltglobmod2.so
531 $(objpfx
)tst-pathopt
: $(libdl
)
532 $(objpfx
)tst-pathopt.out
: tst-pathopt.sh
$(objpfx
)tst-pathopt \
533 $(objpfx
)pathoptobj.so
534 $(SHELL
) -e
$< $(common-objpfx
)
536 $(objpfx
)initfirst
: $(libdl
)
537 $(objpfx
)initfirst.out
: $(objpfx
)firstobj.so
539 $(objpfx
)global
: $(objpfx
)globalmod1.so
540 $(objpfx
)global.out
: $(objpfx
)reldepmod1.so
542 $(objpfx
)dblload
: $(libdl
)
543 $(objpfx
)dblload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
545 $(objpfx
)dblunload
: $(libdl
)
546 $(objpfx
)dblunload.out
: $(objpfx
)dblloadmod1.so
$(objpfx
)dblloadmod2.so
548 $(objpfx
)reldep5
: $(libdl
)
549 $(objpfx
)reldep5.out
: $(objpfx
)reldepmod5.so
$(objpfx
)reldepmod5.so
551 $(objpfx
)reldep6
: $(libdl
)
552 $(objpfx
)reldep6.out
: $(objpfx
)reldep6mod3.so
$(objpfx
)reldep6mod4.so
554 $(objpfx
)reldep7
: $(libdl
)
555 $(objpfx
)reldep7.out
: $(objpfx
)reldep7mod1.so
$(objpfx
)reldep7mod2.so
557 $(objpfx
)reldep8
: $(libdl
)
558 $(objpfx
)reldep8.out
: $(objpfx
)reldep8mod3.so
560 LDFLAGS-nodel2mod2.so
= -Wl
,--enable-new-dtags
,-z
,nodelete
561 $(objpfx
)nodelete2
: $(libdl
)
562 $(objpfx
)nodelete2.out
: $(objpfx
)nodel2mod3.so
564 $(objpfx
)reldep9
: $(libdl
)
565 $(objpfx
)reldep9.out
: $(objpfx
)reldep9mod3.so
567 $(objpfx
)tst-tls3
: $(objpfx
)tst-tlsmod1.so
569 $(objpfx
)tst-tls4
: $(libdl
)
570 $(objpfx
)tst-tls4.out
: $(objpfx
)tst-tlsmod2.so
572 $(objpfx
)tst-tls5
: $(libdl
)
573 $(objpfx
)tst-tls5.out
: $(objpfx
)tst-tlsmod2.so
575 $(objpfx
)tst-tls6
: $(libdl
)
576 $(objpfx
)tst-tls6.out
: $(objpfx
)tst-tlsmod2.so
578 $(objpfx
)tst-tls7
: $(libdl
)
579 $(objpfx
)tst-tls7.out
: $(objpfx
)tst-tlsmod3.so
581 $(objpfx
)tst-tls8
: $(libdl
)
582 $(objpfx
)tst-tls8.out
: $(objpfx
)tst-tlsmod3.so
$(objpfx
)tst-tlsmod4.so
584 $(objpfx
)tst-tls9
: $(libdl
)
585 $(objpfx
)tst-tls9.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
587 $(objpfx
)tst-tls10
: $(objpfx
)tst-tlsmod8.so
589 $(objpfx
)tst-tls11
: $(objpfx
)tst-tlsmod10.so
591 $(objpfx
)tst-tls12
: $(objpfx
)tst-tlsmod12.so
594 $(objpfx
)tst-tls9-static
: $(common-objpfx
)dlfcn
/libdl.a
595 $(objpfx
)tst-tls9-static.out
: $(objpfx
)tst-tlsmod5.so
$(objpfx
)tst-tlsmod6.so
598 $(objpfx
)tst-array1.out
: $(objpfx
)tst-array1
599 $(elf-objpfx
)$(rtld-installed-name
) \
600 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
601 $(objpfx
)tst-array1
> $@
602 cmp
$@ tst-array1.exp
> /dev
/null
604 $(objpfx
)tst-array2
: $(objpfx
)tst-array2dep.so
605 $(objpfx
)tst-array2.out
: $(objpfx
)tst-array2
606 $(elf-objpfx
)$(rtld-installed-name
) \
607 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
608 $(objpfx
)tst-array2
> $@
609 cmp
$@ tst-array2.exp
> /dev
/null
611 $(objpfx
)tst-array3.out
: $(objpfx
)tst-array3
612 $(elf-objpfx
)$(rtld-installed-name
) \
613 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
614 $(objpfx
)tst-array3
> $@
615 cmp
$@ tst-array1.exp
> /dev
/null
617 $(objpfx
)tst-array4
: $(libdl
)
618 $(objpfx
)tst-array4.out
: $(objpfx
)tst-array4
$(objpfx
)tst-array2dep.so
619 $(elf-objpfx
)$(rtld-installed-name
) \
620 --library-path
$(rpath-link
)$(patsubst %,:%,$(sysdep-library-path
)) \
622 cmp
$@ tst-array4.exp
> /dev
/null
624 check-textrel-CFLAGS
= -O
-Wall
-D_XOPEN_SOURCE
=600 -D_BSD_SOURCE
625 $(objpfx
)check-textrel
: check-textrel.c
628 ifeq (yes
,$(build-shared
))
629 tests
: $(objpfx
)check-textrel.out
631 $(objpfx
)check-textrel.out
: $(objpfx
)check-textrel
632 $(dir $<)$(notdir $<) $(common-objpfx
)libc.so \
633 $(sort $(wildcard $(common-objpfx
)*/lib
*.so \
634 $(common-objpfx
)iconvdata
/*.so
)) > $@
635 generated
+= check-textrel check-textrel.out