]>
Commit | Line | Data |
---|---|---|
b71e7ce8 | 1 | # Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. |
01cc0be6 RM |
2 | # This file is part of the GNU C Library. |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU Library General Public License as | |
6 | # published by the Free Software Foundation; either version 2 of the | |
7 | # License, or (at your option) any later version. | |
8 | ||
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 | # Library General Public License for more details. | |
13 | ||
14 | # You should have received a copy of the GNU Library General Public | |
afd4eb37 UD |
15 | # License along with the GNU C Library; see the file COPYING.LIB. If not, |
16 | # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
17 | # Boston, MA 02111-1307, USA. | |
01cc0be6 | 18 | |
3db52d94 UD |
19 | # Makefile for elf subdirectory of GNU C Library. |
20 | ||
d66e34cd RM |
21 | subdir := elf |
22 | ||
019e7a64 | 23 | headers = elf.h bits/elfclass.h link.h |
80d9c5f0 | 24 | routines = $(dl-routines) dl-open dl-close dl-support \ |
94e365c6 | 25 | dl-addr enbl-secure dl-profstub dl-origin dl-libc dl-sym |
266180eb RM |
26 | |
27 | # The core dynamic linking functions are in libc for the static and | |
28 | # profiled libraries. | |
f18edac3 | 29 | dl-routines = $(addprefix dl-,load cache lookup object reloc deps \ |
3996f34b | 30 | runtime error init fini debug misc \ |
d7926ed9 | 31 | version profile) |
b79f74cd | 32 | all-dl-routines = $(dl-routines) $(sysdep-dl-routines) |
266180eb | 33 | # But they are absent from the shared libc, because that code is in ld.so. |
b79f74cd | 34 | elide-routines.os = $(all-dl-routines) dl-support enbl-secure |
266180eb RM |
35 | |
36 | # ld.so uses those routines, plus some special stuff for being the program | |
37 | # interpreter and operating independent of libc. | |
e27b79d3 | 38 | rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal |
e39e6956 | 39 | all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines) |
b79f74cd | 40 | |
94e365c6 | 41 | distribute := $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \ |
b3ed8219 | 42 | dl-cache.h dl-hash.h soinit.c sofini.c ldd.bash.in \ |
94e365c6 UD |
43 | genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \ |
44 | dl-librecon.h interp.c sln.c dl-dst.h hp-timing.h \ | |
c77ec56d | 45 | do-lookup.h dl-lookupcfg.h sprof.c gen-trusted-dirs.awk \ |
94e365c6 | 46 | testobj1.c testobj2.c testobj3.c testobj4.c testobj5.c \ |
2b7238dd | 47 | testobj6.c testobj1_1.c failobj.c unloadmod.c \ |
84ddc586 | 48 | ldconfig.h ldconfig.c cache.c readlib.c readelflib.c \ |
e340a2a2 | 49 | chroot_canon.c gccframe.h \ |
74955460 | 50 | dep1.c dep2.c dep3.c dep4.c dl-dtprocnum.h unsecvars.h \ |
afa0569f | 51 | vismain.c vismod1.c vismod2.c vismod3.c \ |
74dd1fee UD |
52 | constload2.c constload3.c filtmod1.c filtmod2.c \ |
53 | nodlopenmod.c nodelete.c nodelmod1.c nodelmod2.c \ | |
2b7238dd | 54 | nodelmod3.c nodelmod4.c nodlopen.c dl-osinfo.h \ |
917fd061 | 55 | reldepmod1.c reldepmod2.c reldepmod3.c reldepmod4.c \ |
1826d793 | 56 | reldep4mod1.c reldep4mod2.c reldep4mod3.c reldep4mod4.c \ |
8bc6161d | 57 | nextmod1.c nextmod2.c pathoptobj.c tst-pathopt.sh \ |
5ab7f7c1 | 58 | neededobj1.c neededobj2.c neededobj3.c neededobj4.c \ |
421f0c9d | 59 | neededobj5.c neededobj6.c firstobj.c \ |
1a511d31 | 60 | unload2mod.c unload2dep.c ltglobmod1.c ltglobmod2.c \ |
273a3cfb | 61 | testobj.h vismod.h globalmod1.c |
d66e34cd | 62 | |
05f732b3 UD |
63 | include ../Makeconfig |
64 | ||
40c4c9b5 | 65 | before-compile = $(objpfx)trusted-dirs.h |
5a384a91 UD |
66 | generated := trusted-dirs.h trusted-dirs.st for-renamed/renamed.so |
67 | generated-dirs := for-renamed | |
fd26970f | 68 | |
bdd421cc | 69 | ifeq ($(versioning),yes) |
a0edd63e | 70 | ld-map = $(common-objpfx)ld.map |
bdd421cc UD |
71 | endif |
72 | ||
d66e34cd | 73 | ifeq (yes,$(build-shared)) |
b79f74cd | 74 | extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os |
40c4c9b5 | 75 | generated += librtld.os dl-allobjs.os ld.so ldd |
8d57beea | 76 | install-others = $(inst_slibdir)/$(rtld-installed-name) |
b122c703 | 77 | install-bin = ldd |
f49bc43f | 78 | endif |
86d2c878 | 79 | |
9d141cae | 80 | others = sprof sln |
ea278354 | 81 | install-bin += sprof |
9d141cae UD |
82 | others-static = sln |
83 | install-rootsbin = sln | |
ae828bc6 | 84 | |
591e1ffb | 85 | ifeq (yes,$(use-ldconfig)) |
99ac5e47 | 86 | ifeq (yes,$(build-shared)) |
e1586792 | 87 | others-static += ldconfig |
da2d1bc5 | 88 | others += ldconfig |
9d141cae | 89 | install-rootsbin += ldconfig |
591e1ffb | 90 | |
b4a555d6 | 91 | ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon |
591e1ffb UD |
92 | extra-objs += $(ldconfig-modules:=.o) |
93 | ||
94 | # To find xmalloc.c and xstrdup.c | |
95 | vpath %.c ../locale/programs | |
96 | ||
99ac5e47 | 97 | endif |
1ef32c3d UD |
98 | endif |
99 | ||
2f512715 | 100 | ifeq (yes,$(build-shared)) |
19cf43be | 101 | tests = loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ |
2b7238dd | 102 | constload1 order $(tests-vis-$(have-protected)) noload filter unload \ |
1826d793 | 103 | reldep reldep2 reldep3 reldep4 next $(tests-nodelete-$(have-z-nodelete)) \ |
9807e540 | 104 | $(tests-nodlopen-$(have-z-nodlopen)) neededtest neededtest2 \ |
2373b30e UD |
105 | neededtest3 neededtest4 unload2 lateglobal initfirst global \ |
106 | restest2 | |
5a384a91 | 107 | test-srcs = tst-pathopt |
c1025c19 | 108 | tests-vis-yes = vismain |
0fb7851f | 109 | tests-nodelete-yes = nodelete |
2f54c82d | 110 | tests-nodlopen-yes = nodlopen |
2f512715 | 111 | endif |
a25f2023 | 112 | modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ |
2b7238dd | 113 | testobj1_1 failobj constload2 constload3 unloadmod \ |
0fb7851f | 114 | dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \ |
2f54c82d | 115 | $(modules-nodelete-$(have-z-nodelete)) \ |
2b7238dd | 116 | $(modules-nodlopen-$(have-z-nodlopen)) filtmod1 filtmod2 \ |
ceb579a3 | 117 | reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \ |
1826d793 | 118 | reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \ |
8edd9172 | 119 | neededobj1 neededobj2 neededobj3 neededobj4 \ |
273a3cfb | 120 | neededobj5 neededobj6 firstobj globalmod1 \ |
5a384a91 | 121 | unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj |
c1025c19 | 122 | modules-vis-yes = vismod1 vismod2 vismod3 |
2cb8cefb | 123 | modules-nodelete-yes = nodelmod1 nodelmod2 nodelmod3 nodelmod4 |
2f54c82d | 124 | modules-nodlopen-yes = nodlopenmod |
9b014809 | 125 | extra-objs += $(addsuffix .os,$(strip $(modules-names))) |
482eec0d | 126 | |
01cc0be6 | 127 | include ../Rules |
d66e34cd | 128 | |
1ef32c3d | 129 | ifeq (yes,$(build-shared)) |
a89d30d4 RM |
130 | # Make sure these things are built in the `make lib' pass so they can be used |
131 | # to run programs during the `make others' pass. | |
132 | lib-noranlib: $(objpfx)$(rtld-installed-name) \ | |
133 | $(addprefix $(objpfx),$(extra-objs)) | |
134 | endif | |
135 | ||
db2286f6 RM |
136 | # Command to link into a larger single relocatable object. |
137 | reloc-link = $(LINK.o) -nostdlib -nostartfiles -r -o $@ | |
138 | ||
b79f74cd | 139 | $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os) |
db2286f6 RM |
140 | $(reloc-link) $^ |
141 | ||
86d2c878 | 142 | # Link together the dynamic linker into a single relocatable object. |
40a55d20 | 143 | $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a |
db2286f6 | 144 | $(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)' |
d66e34cd | 145 | |
f21acc89 UD |
146 | # Do we need a linker script? |
147 | rtld-ldscript-in := $(firstword $(wildcard $(+sysdep_dirs:%=%/rtld-ldscript.in))) | |
14ea22e9 | 148 | |
f21acc89 | 149 | ifneq (,$(rtld-ldscript-in)) |
880f421f UD |
150 | rtld-ldscript = $(objpfx)rtld-ldscript |
151 | generated += rtld-ldscript | |
152 | ||
153 | LDFLAGS-rtld = -T $(rtld-ldscript) | |
154 | before-compile += $(rtld-ldscript) | |
f21acc89 | 155 | |
f21acc89 UD |
156 | rtld-parms = $(wildcard $(+sysdep_dirs:%=%/rtld-parms)) |
157 | include $(rtld-parms) | |
880f421f UD |
158 | |
159 | $(rtld-ldscript): $(rtld-ldscript-in) $(rtld-parms) | |
f21acc89 UD |
160 | sed -e 's#@@rtld-oformat@@#$(rtld-oformat)#' \ |
161 | -e 's#@@rtld-arch@@#$(rtld-arch)#' \ | |
162 | -e 's#@@rtld-entry@@#$(rtld-entry)#' \ | |
163 | -e 's#@@rtld-base@@#$(rtld-base)#' $< >$@ | |
880f421f | 164 | endif |
f21acc89 | 165 | |
2f444823 | 166 | $(objpfx)ld.so: $(objpfx)librtld.os $(rtld-ldscript) $(ld-map) |
7ef90c15 UD |
167 | $(LINK.o) -nostdlib -nostartfiles -shared -o $@ $(LDFLAGS-rtld) \ |
168 | $(filter-out $(rtld-ldscript) $(map-file),$^) \ | |
169 | $(load-map-file) -Wl,-soname=$(rtld-installed-name) | |
266180eb | 170 | |
c7562c74 UD |
171 | # interp.c exists just to get this string into the libraries. |
172 | CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' | |
173 | ||
1ef32c3d | 174 | ifneq (ld.so,$(rtld-installed-name)) |
afd4eb37 | 175 | # Make sure ld.so.1 exists in the build directory so we can link |
852fc4b9 RM |
176 | # against it. |
177 | $(objpfx)$(rtld-installed-name): $(objpfx)ld.so | |
178 | rm -f $@ | |
f332db02 | 179 | ln -s $(<F) $@ |
da2d1bc5 | 180 | generated += $(rtld-installed-name) |
852fc4b9 RM |
181 | endif |
182 | ||
fd26970f UD |
183 | # Build a file mentioning all trustworthy directories to look for shared |
184 | # libraries when using LD_LIBRARY_PATH in a setuid program. The user can | |
185 | # add directories to the list by defining $(user-defined-trusted-dirs) | |
186 | # before starting make. | |
6598ac30 UD |
187 | $(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @: |
188 | $(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig | |
1ef32c3d | 189 | $(make-target-directory) |
ab7eb292 UD |
190 | echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \ |
191 | | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T}; | |
6598ac30 UD |
192 | $(move-if-change) ${@:st=T} ${@:st=h} |
193 | touch $@ | |
a986484f | 194 | CPPFLAGS-dl-load.c = -I$(objpfx). -I$(csu-objpfx). |
86d2c878 | 195 | |
9f2a9248 | 196 | ifeq (yes,$(build-shared)) |
73237de3 | 197 | $(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force) |
460adbb8 | 198 | $(make-target-directory) |
925e31d9 | 199 | $(do-install-program) |
1ef32c3d | 200 | |
8d57beea | 201 | $(inst_slibdir)/$(rtld-installed-name): \ |
460adbb8 UD |
202 | $(inst_slibdir)/$(rtld-version-installed-name) \ |
203 | $(inst_slibdir)/libc-$(version).so | |
925e31d9 | 204 | $(make-shlib-link) |
b122c703 | 205 | |
5148d49f UD |
206 | # Special target called by parent to install just the dynamic linker. |
207 | .PHONY: ldso_install | |
208 | ldso_install: $(inst_slibdir)/$(rtld-installed-name) | |
9f2a9248 | 209 | endif |
5148d49f | 210 | |
cb343854 | 211 | |
926e512f RM |
212 | common-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \ |
213 | -e 's%@VERSION@%$(version)%g' | |
1ddf537f | 214 | sh-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%/bin/sh%g;s/\$$"/"/g' |
926e512f | 215 | bash-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%$(BASH)%g' \ |
4a33c2f5 | 216 | -e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g' |
cb343854 | 217 | |
84384f5b | 218 | ifneq ($(have-bash2),yes) |
cb343854 | 219 | ldd-shell = sh |
e2102c14 UD |
220 | else |
221 | ldd-shell = bash | |
cb343854 UD |
222 | endif |
223 | ||
224 | ifeq ($(ldd-rewrite-script),no) | |
225 | define gen-ldd | |
226 | sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new | |
227 | endef | |
84384f5b | 228 | else |
cb343854 UD |
229 | define gen-ldd |
230 | sed $($(ldd-shell)-ldd-rewrite) < $< | sed -f $(ldd-rewrite-script) > $@.new | |
231 | endef | |
232 | endif | |
233 | ||
926e512f | 234 | $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \ |
ee74a442 | 235 | $(common-objpfx)config.make |
cb343854 | 236 | $(gen-ldd) |
84384f5b UD |
237 | chmod 555 $@.new |
238 | mv -f $@.new $@ | |
cb343854 | 239 | |
aaff4ba9 | 240 | $(objpfx)sprof: $(libdl) |
94e365c6 | 241 | |
591e1ffb | 242 | $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) |
8ca91b36 UD |
243 | SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' |
244 | CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' -D'SLIBDIR="$(slibdir)"' | |
245 | CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) | |
246 | CFLAGS-cache.c = $(SYSCONF-FLAGS) | |
591e1ffb | 247 | |
9b014809 UD |
248 | test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names)))) |
249 | generated += $(addsuffix .so,$(strip $(modules-names))) | |
482eec0d | 250 | |
e1e3ba54 | 251 | ifeq (yes,$(build-shared)) |
8c0fe290 | 252 | ifeq ($(cross-compiling),no) |
5a384a91 | 253 | tests: $(objpfx)tst-pathopt.out |
e1e3ba54 | 254 | endif |
8c0fe290 | 255 | endif |
5a384a91 | 256 | |
aaff4ba9 UD |
257 | $(objpfx)testobj1.so: $(libdl) |
258 | $(objpfx)testobj1_1.so: $(objpfx)testobj1.so $(libdl) | |
259 | $(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl) | |
260 | $(objpfx)testobj3.so: $(libdl) | |
261 | $(objpfx)testobj4.so: $(libdl) | |
262 | $(objpfx)testobj5.so: $(libdl) | |
e30f2b98 | 263 | $(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so $(libdl) |
e18db2b0 | 264 | $(objpfx)failobj.so: $(objpfx)testobj6.so |
84ddc586 UD |
265 | $(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so |
266 | $(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so | |
267 | $(objpfx)dep4.so: $(objpfx)dep3.so | |
2cb8cefb | 268 | $(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so |
917fd061 | 269 | $(objpfx)nextmod1.so: $(libdl) |
ceb579a3 UD |
270 | $(objpfx)neededobj1.so: $(libdl) |
271 | $(objpfx)neededobj2.so: $(objpfx)neededobj1.so $(libdl) | |
272 | $(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so $(libdl) | |
8edd9172 UD |
273 | $(objpfx)neededobj4.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ |
274 | $(objpfx)neededobj3.so $(libdl) | |
c77a4478 | 275 | $(objpfx)neededobj6.so: $(objpfx)neededobj5.so |
f6de2239 | 276 | $(objpfx)unload2mod.so: $(objpfx)unload2dep.so |
d785c366 | 277 | $(objpfx)ltglobmod2.so: $(libdl) |
b71e7ce8 | 278 | $(objpfx)firstobj.so: $(shared-thread-library) |
273a3cfb | 279 | $(objpfx)globalmod1.so: $(libdl) |
1826d793 UD |
280 | $(objpfx)reldep4mod1.so: $(objpfx)reldep4mod3.so |
281 | $(objpfx)reldep4mod2.so: $(objpfx)reldep4mod4.so | |
ceb579a3 | 282 | |
10b36b41 AJ |
283 | # filtmod1.so has a special rule |
284 | $(filter-out $(objpfx)filtmod1.so, $(test-modules)): $(objpfx)%.so: $(objpfx)%.os | |
482eec0d UD |
285 | $(build-module) |
286 | ||
aaff4ba9 | 287 | $(objpfx)loadtest: $(libdl) |
482eec0d UD |
288 | LDFLAGS-loadtest = -rdynamic |
289 | ||
290 | $(objpfx)loadtest.out: $(test-modules) | |
6bd06384 | 291 | |
ceb579a3 | 292 | $(objpfx)neededtest: $(libdl) |
ceb579a3 | 293 | $(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ |
8edd9172 | 294 | $(objpfx)neededobj3.so |
ceb579a3 | 295 | |
9807e540 UD |
296 | $(objpfx)neededtest2: $(libdl) |
297 | $(objpfx)neededtest2.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ | |
8edd9172 UD |
298 | $(objpfx)neededobj3.so |
299 | ||
300 | $(objpfx)neededtest3: $(libdl) | |
301 | $(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \ | |
302 | $(objpfx)neededobj3.so $(objpfx)neededobj4.so | |
9807e540 | 303 | |
c77a4478 UD |
304 | neededtest4-ENV = LC_ALL=C LANGUAGE=C |
305 | $(objpfx)neededtest4: $(libdl) $(objpfx)neededobj1.so | |
306 | $(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so | |
307 | ||
aaff4ba9 | 308 | $(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so $(libdl) |
e18db2b0 | 309 | LDFLAGS-restest1 = -rdynamic |
6bd06384 | 310 | |
2373b30e UD |
311 | $(objpfx)restest2: $(libdl) |
312 | LDFLAGS-restest2 = -rdynamic | |
313 | ||
6bd06384 | 314 | $(objpfx)restest1.out: $(test-modules) |
3d91edb2 | 315 | |
e18db2b0 | 316 | preloadtest-preloads = testobj1 testobj2 testobj3 testobj4 testobj5 |
10584d2e | 317 | $(objpfx)preloadtest: $(objpfx)testobj6.so |
10584d2e | 318 | LDFLAGS-preloadtest = -rdynamic |
e18db2b0 UD |
319 | $(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so) |
320 | preloadtest-ENV = \ | |
321 | LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so))) | |
1e262312 | 322 | |
aaff4ba9 | 323 | $(objpfx)loadfail: $(libdl) |
1e262312 UD |
324 | LDFLAGS-loadfail = -rdynamic |
325 | ||
61e0617a UD |
326 | $(objpfx)loadfail.out: $(objpfx)failobj.so |
327 | ||
328 | $(objpfx)multiload: $(libdl) | |
329 | LDFLAGS-multiload = -rdynamic | |
9df54168 | 330 | CFLAGS-multiload.c = -DOBJDIR=\"$(elf-objpfx)\" |
61e0617a UD |
331 | |
332 | $(objpfx)multiload.out: $(objpfx)testobj1.so | |
dc5efe83 UD |
333 | |
334 | $(objpfx)origtest: $(libdl) | |
394679eb | 335 | LDFLAGS-origtest = -rdynamic |
dc5efe83 | 336 | $(objpfx)origtest.out: $(objpfx)testobj1.so |
ff5fad16 UD |
337 | |
338 | ifeq ($(have-thread-library),yes) | |
339 | $(objpfx)resolvfail: $(libdl) $(shared-thread-library) | |
340 | else | |
341 | $(objpfx)resolvfail: $(libdl) | |
342 | endif | |
19cf43be UD |
343 | |
344 | $(objpfx)constload1: $(libdl) | |
345 | $(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so | |
84ddc586 UD |
346 | |
347 | $(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so) | |
348 | ||
349 | $(objpfx)order.out: $(objpfx)order | |
350 | $(elf-objpfx)$(rtld-installed-name) \ | |
351 | --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \ | |
352 | $(objpfx)order > $@ | |
353 | (echo "0123456789" | cmp $@ -) > /dev/null | |
c1025c19 UD |
354 | |
355 | $(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so) | |
356 | $(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so) | |
357 | vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so) | |
5e61ef88 UD |
358 | |
359 | $(objpfx)noload: $(objpfx)testobj1.so | |
360 | LDFLAGS-noload = -rdynamic | |
361 | $(objpfx)noload.out: $(objpfx)testobj5.so | |
0fb7851f | 362 | |
ad7534c8 | 363 | LDFLAGS-nodelete = -rdynamic |
0fb7851f | 364 | LDFLAGS-nodelmod1.so = -Wl,--enable-new-dtags,-z,nodelete |
2cb8cefb | 365 | LDFLAGS-nodelmod4.so = -Wl,--enable-new-dtags,-z,nodelete |
0fb7851f | 366 | $(objpfx)nodelete: $(libdl) |
2cb8cefb UD |
367 | $(objpfx)nodelete.out: $(objpfx)nodelmod1.so $(objpfx)nodelmod2.so \ |
368 | $(objpfx)nodelmod3.so | |
2f54c82d UD |
369 | |
370 | LDFLAGS-nodlopenmod.so = -Wl,--enable-new-dtags,-z,nodlopen | |
371 | $(objpfx)nodlopen: $(libdl) | |
372 | $(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so | |
fcacb36a | 373 | |
137bca87 UD |
374 | $(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so |
375 | $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \ | |
376 | -L$(subst :, -L,$(rpath-link)) \ | |
377 | -Wl,-rpath-link=$(rpath-link) \ | |
378 | $< -Wl,-F,$(objpfx)filtmod2.so | |
fcacb36a | 379 | $(objpfx)filter: $(objpfx)filtmod1.so |
2b7238dd UD |
380 | |
381 | $(objpfx)unload: $(libdl) | |
382 | $(objpfx)unload.out: $(objpfx)unloadmod.so | |
383 | ||
384 | $(objpfx)reldep: $(libdl) | |
385 | $(objpfx)reldep.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod2.so | |
386 | ||
387 | $(objpfx)reldep2: $(libdl) | |
388 | $(objpfx)reldep2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so | |
389 | ||
390 | $(objpfx)reldep3: $(libdl) | |
391 | $(objpfx)reldep3.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so | |
917fd061 | 392 | |
1826d793 UD |
393 | $(objpfx)reldep4: $(libdl) |
394 | $(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so | |
395 | ||
917fd061 | 396 | $(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so $(libdl) |
f6de2239 UD |
397 | |
398 | $(objpfx)unload2: $(libdl) | |
399 | $(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so | |
d785c366 UD |
400 | |
401 | $(objpfx)lateglobal: $(libdl) | |
402 | $(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so | |
5a384a91 UD |
403 | |
404 | $(objpfx)tst-pathopt: $(libdl) | |
405 | $(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \ | |
406 | $(objpfx)pathoptobj.so | |
407 | $(SHELL) -e $< $(common-objpfx) | |
b71e7ce8 UD |
408 | |
409 | $(objpfx)initfirst: $(libdl) | |
410 | $(objpfx)initfirst.out: $(objpfx)firstobj.so | |
273a3cfb UD |
411 | |
412 | $(objpfx)global: $(objpfx)globalmod1.so | |
413 | $(objpfx)global.out: $(objpfx)reldepmod1.so |