]> sourceware.org Git - glibc.git/blame - elf/Makefile
Update.
[glibc.git] / elf / Makefile
CommitLineData
aff4519d 1# Copyright (C) 1995-2002, 2003 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
41bdb6e2
AJ
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.
01cc0be6
RM
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
41bdb6e2 12# Lesser General Public License for more details.
01cc0be6 13
41bdb6e2
AJ
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
17# 02111-1307 USA.
01cc0be6 18
3db52d94
UD
19# Makefile for elf subdirectory of GNU C Library.
20
d66e34cd
RM
21subdir := elf
22
019e7a64 23headers = elf.h bits/elfclass.h link.h
39ab0fdf
UD
24routines = $(dl-routines) dl-open dl-close dl-support dl-iteratephdr \
25 dl-iteratephdr-static dl-addr enbl-secure dl-profstub \
ce460d04 26 dl-origin dl-libc dl-sym dl-tsd
266180eb
RM
27
28# The core dynamic linking functions are in libc for the static and
29# profiled libraries.
f18edac3 30dl-routines = $(addprefix dl-,load cache lookup object reloc deps \
3996f34b 31 runtime error init fini debug misc \
e6caf4e1 32 version profile conflict tls origin)
b79f74cd 33all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
266180eb 34# But they are absent from the shared libc, because that code is in ld.so.
39ab0fdf 35elide-routines.os = $(all-dl-routines) dl-support enbl-secure \
e6caf4e1 36 dl-iteratephdr-static dl-origin
266180eb
RM
37
38# ld.so uses those routines, plus some special stuff for being the program
39# interpreter and operating independent of libc.
ce460d04 40rtld-routines := rtld $(dl-routines) dl-sysdep dl-environ dl-minimal
e39e6956 41all-rtld-routines = $(rtld-routines) $(sysdep-rtld-routines)
b79f74cd 42
ce460d04
RM
43distribute := rtld-Rules \
44 $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
b3ed8219 45 dl-cache.h dl-hash.h soinit.c sofini.c ldd.bash.in \
94e365c6
UD
46 genrtldtbl.awk atomicity.h dl-procinfo.h ldsodefs.h \
47 dl-librecon.h interp.c sln.c dl-dst.h hp-timing.h \
c77ec56d 48 do-lookup.h dl-lookupcfg.h sprof.c gen-trusted-dirs.awk \
94e365c6 49 testobj1.c testobj2.c testobj3.c testobj4.c testobj5.c \
2b7238dd 50 testobj6.c testobj1_1.c failobj.c unloadmod.c \
84ddc586 51 ldconfig.h ldconfig.c cache.c readlib.c readelflib.c \
e340a2a2 52 chroot_canon.c gccframe.h \
74955460 53 dep1.c dep2.c dep3.c dep4.c dl-dtprocnum.h unsecvars.h \
afa0569f 54 vismain.c vismod1.c vismod2.c vismod3.c \
74dd1fee
UD
55 constload2.c constload3.c filtmod1.c filtmod2.c \
56 nodlopenmod.c nodelete.c nodelmod1.c nodelmod2.c \
2b7238dd 57 nodelmod3.c nodelmod4.c nodlopen.c dl-osinfo.h \
917fd061 58 reldepmod1.c reldepmod2.c reldepmod3.c reldepmod4.c \
c4bb124a 59 reldepmod5.c reldepmod6.c \
1826d793 60 reldep4mod1.c reldep4mod2.c reldep4mod3.c reldep4mod4.c \
8bc6161d 61 nextmod1.c nextmod2.c pathoptobj.c tst-pathopt.sh \
5ab7f7c1 62 neededobj1.c neededobj2.c neededobj3.c neededobj4.c \
421f0c9d 63 neededobj5.c neededobj6.c firstobj.c \
1a511d31 64 unload2mod.c unload2dep.c ltglobmod1.c ltglobmod2.c \
3fac0001 65 testobj.h vismod.h globalmod1.c \
ab92bebd
UD
66 dblloadmod1.c dblloadmod2.c dblloadmod3.c \
67 reldep6mod4.c reldep6mod3.c reldep6mod2.c reldep6mod1.c \
a41d8a74 68 reldep6mod0.c reldep7mod1.c reldep7mod2.c \
ab92bebd 69 unwind-dw2.c unwind-dw2-fde.c unwind.h unwind-pe.h \
2cef4257 70 unwind-dw2-fde.h dwarf2.h dl-procinfo.c tls.h dl-tls.h \
4c53d221 71 tst-tlsmod1.c tst-tlsmod2.c tst-tlsmod3.c tst-tlsmod4.c \
6ef518c3 72 tst-tlsmod5.c tst-tlsmod6.c \
4c53d221
UD
73 circlemod1.c circlemod1a.c circlemod2.c circlemod2a.c \
74 circlemod3.c circlemod3a.c nodlopenmod2.c \
cfaf5e56 75 tls-macros.h \
aff4519d
UD
76 reldep8mod1.c reldep8mod2.c reldep8mod3.c \
77 nodel2mod1.c nodel2mod2.c nodel2mod3.c \
78 reldep9mod1.c reldep9mod2.c reldep9mod3.c
d66e34cd 79
05f732b3
UD
80include ../Makeconfig
81
74bd2300 82ifeq ($(unwind-find-fde),yes)
a0dcb689
UD
83routines += unwind-dw2-fde-glibc
84shared-only-routines = unwind-dw2-fde-glibc
74bd2300
UD
85endif
86
40c4c9b5 87before-compile = $(objpfx)trusted-dirs.h
5a384a91
UD
88generated := trusted-dirs.h trusted-dirs.st for-renamed/renamed.so
89generated-dirs := for-renamed
fd26970f 90
bdd421cc 91ifeq ($(versioning),yes)
a0edd63e 92ld-map = $(common-objpfx)ld.map
bdd421cc
UD
93endif
94
d66e34cd 95ifeq (yes,$(build-shared))
b79f74cd 96extra-objs = $(all-rtld-routines:%=%.os) soinit.os sofini.os interp.os
40c4c9b5 97generated += librtld.os dl-allobjs.os ld.so ldd
8d57beea 98install-others = $(inst_slibdir)/$(rtld-installed-name)
6c3ebebd 99install-bin-script = ldd
f49bc43f 100endif
86d2c878 101
9d141cae 102others = sprof sln
6c3ebebd 103install-bin = sprof
9d141cae
UD
104others-static = sln
105install-rootsbin = sln
ae828bc6 106
591e1ffb 107ifeq (yes,$(use-ldconfig))
99ac5e47 108ifeq (yes,$(build-shared))
e1586792 109others-static += ldconfig
da2d1bc5 110others += ldconfig
9d141cae 111install-rootsbin += ldconfig
591e1ffb 112
b4a555d6 113ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon
591e1ffb
UD
114extra-objs += $(ldconfig-modules:=.o)
115
116# To find xmalloc.c and xstrdup.c
117vpath %.c ../locale/programs
118
99ac5e47 119endif
1ef32c3d
UD
120endif
121
6ef518c3 122tests = tst-tls1 tst-tls2 tst-tls9
dfe4c900 123ifeq (yes,$(have-initfini-array))
62f29da7 124tests += tst-array1 tst-array2 tst-array3 tst-array4
dfe4c900 125endif
db265313
RM
126ifeq (yes,$(build-static))
127tests-static = tst-tls1-static tst-tls2-static
6ef518c3
RM
128ifeq (yesyesyes,$(build-static)$(build-shared)$(elf))
129tests-static += tst-tls9-static
130tst-tls9-static-ENV = \
131 LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)dlfcn
132endif
db265313
RM
133tests += $(tests-static)
134endif
2f512715 135ifeq (yes,$(build-shared))
db265313
RM
136tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
137 constload1 order $(tests-vis-$(have-protected)) noload filter unload \
138 reldep reldep2 reldep3 reldep4 $(tests-nodelete-$(have-z-nodelete)) \
139 $(tests-nodlopen-$(have-z-nodlopen)) neededtest neededtest2 \
140 neededtest3 neededtest4 unload2 lateglobal initfirst global \
cfaf5e56
UD
141 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
142 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8
aff4519d 143# reldep9
5a384a91 144test-srcs = tst-pathopt
c1025c19 145tests-vis-yes = vismain
aff4519d 146tests-nodelete-yes = nodelete nodelete2
87837aac 147tests-nodlopen-yes = nodlopen nodlopen2
2f512715 148endif
a25f2023 149modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
2b7238dd 150 testobj1_1 failobj constload2 constload3 unloadmod \
0fb7851f 151 dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \
2f54c82d 152 $(modules-nodelete-$(have-z-nodelete)) \
2b7238dd 153 $(modules-nodlopen-$(have-z-nodlopen)) filtmod1 filtmod2 \
ceb579a3 154 reldepmod1 reldepmod2 reldepmod3 reldepmod4 nextmod1 nextmod2 \
1826d793 155 reldep4mod1 reldep4mod2 reldep4mod3 reldep4mod4 \
8edd9172 156 neededobj1 neededobj2 neededobj3 neededobj4 \
273a3cfb 157 neededobj5 neededobj6 firstobj globalmod1 \
3fac0001 158 unload2mod unload2dep ltglobmod1 ltglobmod2 pathoptobj \
c47e78b1 159 dblloadmod1 dblloadmod2 dblloadmod3 reldepmod5 reldepmod6 \
2e36cb48 160 reldep6mod0 reldep6mod1 reldep6mod2 reldep6mod3 reldep6mod4 \
a41d8a74 161 reldep7mod1 reldep7mod2 \
6d78cd00 162 tst-tlsmod1 tst-tlsmod2 tst-tlsmod3 tst-tlsmod4 \
6ef518c3 163 tst-tlsmod5 tst-tlsmod6 \
6d78cd00 164 circlemod1 circlemod1a circlemod2 circlemod2a \
cfaf5e56 165 circlemod3 circlemod3a \
aff4519d
UD
166 reldep8mod1 reldep8mod2 reldep8mod3 \
167 reldep9mod1 reldep9mod2 reldep9mod3
dfe4c900
RM
168ifeq (yes,$(have-initfini-array))
169modules-names += tst-array2dep
170endif
c1025c19 171modules-vis-yes = vismod1 vismod2 vismod3
aff4519d
UD
172modules-nodelete-yes = nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
173 nodel2mod1 nodel2mod2 nodel2mod3
87837aac 174modules-nodlopen-yes = nodlopenmod nodlopenmod2
9b014809 175extra-objs += $(addsuffix .os,$(strip $(modules-names)))
724d8c3f
RM
176# We need this variable to be sure the test modules get the right CPPFLAGS.
177test-extras += $(modules-names)
dc18d4d8 178
01cc0be6 179include ../Rules
d66e34cd 180
1ef32c3d 181ifeq (yes,$(build-shared))
a89d30d4
RM
182# Make sure these things are built in the `make lib' pass so they can be used
183# to run programs during the `make others' pass.
184lib-noranlib: $(objpfx)$(rtld-installed-name) \
185 $(addprefix $(objpfx),$(extra-objs))
186endif
187
db2286f6 188# Command to link into a larger single relocatable object.
ce460d04 189reloc-link = $(LINK.o) -nostdlib -nostartfiles -r
db2286f6 190
b79f74cd 191$(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os)
ce460d04 192 $(reloc-link) -o $@ $^
db2286f6 193
86d2c878 194# Link together the dynamic linker into a single relocatable object.
ce460d04
RM
195# First we do a link against libc_pic.a just to get a link map,
196# and discard the object produced by that link. From the link map
197# we can glean all the libc modules that need to go into the dynamic
198# linker. Then we do a recursive make that goes into all the subdirs
199# those modules come from and builds special rtld-foo.os versions that
200# are compiled with special flags, and puts these modules into rtld-libc.a
201# for us. Then we do the real link using rtld-libc.a instead of libc_pic.a.
202
203$(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
240e87c2
RM
204 @-rm -f $@T
205 $(reloc-link) -o $@.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T
ce460d04 206 rm -f $@.o
240e87c2 207 mv -f $@T $@
ce460d04
RM
208
209$(objpfx)librtld.mk: $(objpfx)librtld.map Makefile
27b85a94 210 sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\))$$@\1 \2@p' $< | \
ce460d04
RM
211 while read lib file; do \
212 case $$lib in \
213 libc_pic.a) \
214 fgrep -l /$$file \
215 $(common-objpfx)stamp.os $(common-objpfx)*/stamp.os | \
216 sed 's@^$(common-objpfx)\([^/]*\)/stamp\.os$$@rtld-\1'" +=$$file@"\
217 ;; \
218 */*.a) \
219 echo rtld-$${lib%%/*} += $$file ;; \
220 *) echo "Wasn't expecting $$lib($$file)" >&2; exit 1 ;; \
221 esac; \
222 done > $@T
223 echo rtld-subdirs = `sed 's/^rtld-\([^ ]*\).*$$/\1/' $@T \
224 | sort -u` >> $@T
225 mv -f $@T $@
226
227$(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE
228 $(MAKE) -f $< -f rtld-Rules
229
230generated += librtld.map librtld.mk rtld-libc.a
231
232$(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a
233 $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)'
d66e34cd 234
32e6df36 235$(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
070cadeb 236 @rm -f $@.lds
32e6df36 237 $(LINK.o) -nostdlib -nostartfiles -shared \
9ae10332 238 $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \
32e6df36
UD
239 sed -e '/^=========/,/^=========/!d;/^=========/d' \
240 -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
070cadeb 241 > $@.lds
9ae10332
RM
242 $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
243 $(LDFLAGS-rtld) -Wl,-z,defs \
32e6df36 244 $(filter-out $(map-file),$^) $(load-map-file) \
070cadeb 245 -Wl,-soname=$(rtld-installed-name) -T $@.lds
32e6df36 246 rm -f $@.lds
266180eb 247
c7562c74
UD
248# interp.c exists just to get this string into the libraries.
249CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"'
656f8223 250$(objpfx)interp.os: $(common-objpfx)config.make
c7562c74 251
1ef32c3d 252ifneq (ld.so,$(rtld-installed-name))
afd4eb37 253# Make sure ld.so.1 exists in the build directory so we can link
852fc4b9
RM
254# against it.
255$(objpfx)$(rtld-installed-name): $(objpfx)ld.so
256 rm -f $@
f332db02 257 ln -s $(<F) $@
da2d1bc5 258generated += $(rtld-installed-name)
852fc4b9
RM
259endif
260
fd26970f
UD
261# Build a file mentioning all trustworthy directories to look for shared
262# libraries when using LD_LIBRARY_PATH in a setuid program. The user can
263# add directories to the list by defining $(user-defined-trusted-dirs)
264# before starting make.
6598ac30
UD
265$(objpfx)trusted-dirs.h: $(objpfx)trusted-dirs.st; @:
266$(objpfx)trusted-dirs.st: Makefile $(..)Makeconfig
1ef32c3d 267 $(make-target-directory)
ab7eb292
UD
268 echo "$(subst :, ,$(default-rpath) $(user-defined-trusted-dirs))" \
269 | $(AWK) -f gen-trusted-dirs.awk > ${@:st=T};
ce460d04 270 echo '#define DL_DST_LIB "$(notdir $(slibdir))"' >> ${@:st=T}
6598ac30
UD
271 $(move-if-change) ${@:st=T} ${@:st=h}
272 touch $@
a986484f 273CPPFLAGS-dl-load.c = -I$(objpfx). -I$(csu-objpfx).
86d2c878 274
9f2a9248 275ifeq (yes,$(build-shared))
73237de3 276$(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so $(+force)
460adbb8 277 $(make-target-directory)
925e31d9 278 $(do-install-program)
1ef32c3d 279
8d57beea 280$(inst_slibdir)/$(rtld-installed-name): \
460adbb8
UD
281 $(inst_slibdir)/$(rtld-version-installed-name) \
282 $(inst_slibdir)/libc-$(version).so
925e31d9 283 $(make-shlib-link)
b122c703 284
5148d49f
UD
285# Special target called by parent to install just the dynamic linker.
286.PHONY: ldso_install
287ldso_install: $(inst_slibdir)/$(rtld-installed-name)
9f2a9248 288endif
5148d49f 289
cb343854 290
926e512f
RM
291common-ldd-rewrite = -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
292 -e 's%@VERSION@%$(version)%g'
1ddf537f 293sh-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%/bin/sh%g;s/\$$"/"/g'
926e512f 294bash-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%$(BASH)%g' \
4a33c2f5 295 -e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g'
cb343854 296
84384f5b 297ifneq ($(have-bash2),yes)
cb343854 298ldd-shell = sh
e2102c14
UD
299else
300ldd-shell = bash
cb343854
UD
301endif
302
303ifeq ($(ldd-rewrite-script),no)
304define gen-ldd
305sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new
306endef
84384f5b 307else
cb343854
UD
308define gen-ldd
309sed $($(ldd-shell)-ldd-rewrite) < $< | sed -f $(ldd-rewrite-script) > $@.new
310endef
311endif
312
926e512f 313$(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \
ee74a442 314 $(common-objpfx)config.make
cb343854 315 $(gen-ldd)
84384f5b
UD
316 chmod 555 $@.new
317 mv -f $@.new $@
cb343854 318
aaff4ba9 319$(objpfx)sprof: $(libdl)
94e365c6 320
591e1ffb 321$(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
8ca91b36
UD
322SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
323CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' -D'SLIBDIR="$(slibdir)"'
324CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
325CFLAGS-cache.c = $(SYSCONF-FLAGS)
591e1ffb 326
ce460d04 327CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
0d01dace 328
9b014809
UD
329test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
330generated += $(addsuffix .so,$(strip $(modules-names)))
482eec0d 331
e1e3ba54 332ifeq (yes,$(build-shared))
8c0fe290 333ifeq ($(cross-compiling),no)
5a384a91 334tests: $(objpfx)tst-pathopt.out
e1e3ba54 335endif
8c0fe290 336endif
5a384a91 337
aaff4ba9
UD
338$(objpfx)testobj1.so: $(libdl)
339$(objpfx)testobj1_1.so: $(objpfx)testobj1.so $(libdl)
340$(objpfx)testobj2.so: $(objpfx)testobj1.so $(libdl)
341$(objpfx)testobj3.so: $(libdl)
342$(objpfx)testobj4.so: $(libdl)
343$(objpfx)testobj5.so: $(libdl)
e30f2b98 344$(objpfx)testobj6.so: $(objpfx)testobj1.so $(objpfx)testobj2.so $(libdl)
e18db2b0 345$(objpfx)failobj.so: $(objpfx)testobj6.so
84ddc586
UD
346$(objpfx)dep1.so: $(objpfx)dep2.so $(objpfx)dep4.so
347$(objpfx)dep2.so: $(objpfx)dep3.so $(objpfx)dep4.so
348$(objpfx)dep4.so: $(objpfx)dep3.so
2cb8cefb 349$(objpfx)nodelmod3.so: $(objpfx)nodelmod4.so
917fd061 350$(objpfx)nextmod1.so: $(libdl)
ceb579a3
UD
351$(objpfx)neededobj1.so: $(libdl)
352$(objpfx)neededobj2.so: $(objpfx)neededobj1.so $(libdl)
353$(objpfx)neededobj3.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so $(libdl)
8edd9172
UD
354$(objpfx)neededobj4.so: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
355 $(objpfx)neededobj3.so $(libdl)
c77a4478 356$(objpfx)neededobj6.so: $(objpfx)neededobj5.so
f6de2239 357$(objpfx)unload2mod.so: $(objpfx)unload2dep.so
d785c366 358$(objpfx)ltglobmod2.so: $(libdl)
b71e7ce8 359$(objpfx)firstobj.so: $(shared-thread-library)
273a3cfb 360$(objpfx)globalmod1.so: $(libdl)
1826d793
UD
361$(objpfx)reldep4mod1.so: $(objpfx)reldep4mod3.so
362$(objpfx)reldep4mod2.so: $(objpfx)reldep4mod4.so
3fac0001
UD
363$(objpfx)dblloadmod1.so: $(objpfx)dblloadmod3.so
364$(objpfx)dblloadmod2.so: $(objpfx)dblloadmod3.so
c4bb124a
UD
365$(objpfx)reldepmod5.so: $(objpfx)reldepmod2.so
366$(objpfx)reldepmod6.so: $(objpfx)reldepmod2.so
c47e78b1
UD
367$(objpfx)reldep6mod1.so: $(objpfx)reldep6mod0.so
368$(objpfx)reldep6mod2.so: $(objpfx)reldep6mod1.so
369$(objpfx)reldep6mod3.so: $(objpfx)reldep6mod2.so
370$(objpfx)reldep6mod4.so: $(objpfx)reldep6mod1.so
fc093be1 371$(objpfx)tst-tlsmod3.so: $(objpfx)tst-tlsmod2.so
aff4519d
UD
372# For tst-tls9-static, make sure the modules it dlopens have libc.so in DT_NEEDED
373$(objpfx)tst-tlsmod5.so: $(common-objpfx)libc.so
374$(objpfx)tst-tlsmod6.so: $(common-objpfx)libc.so
556224ab 375$(objpfx)reldep8mod3.so: $(objpfx)reldep8mod1.so $(objpfx)reldep8mod2.so
aff4519d
UD
376$(objpfx)nodel2mod3.so: $(objpfx)nodel2mod1.so $(objpfx)nodel2mod2.so
377$(objpfx)reldep9mod2.so: $(objpfx)reldep9mod1.so
378$(objpfx)reldep9mod3.so: $(objpfx)reldep9mod1.so $(objpfx)reldep9mod2.so
ceb579a3 379
6ef518c3
RM
380LDFLAGS-tst-tlsmod5.so = -nostdlib
381LDFLAGS-tst-tlsmod6.so = -nostdlib
382
10b36b41
AJ
383# filtmod1.so has a special rule
384$(filter-out $(objpfx)filtmod1.so, $(test-modules)): $(objpfx)%.so: $(objpfx)%.os
482eec0d
UD
385 $(build-module)
386
aaff4ba9 387$(objpfx)loadtest: $(libdl)
482eec0d
UD
388LDFLAGS-loadtest = -rdynamic
389
390$(objpfx)loadtest.out: $(test-modules)
6bd06384 391
ceb579a3 392$(objpfx)neededtest: $(libdl)
ceb579a3 393$(objpfx)neededtest.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
8edd9172 394 $(objpfx)neededobj3.so
ceb579a3 395
9807e540
UD
396$(objpfx)neededtest2: $(libdl)
397$(objpfx)neededtest2.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
8edd9172
UD
398 $(objpfx)neededobj3.so
399
400$(objpfx)neededtest3: $(libdl)
401$(objpfx)neededtest3.out: $(objpfx)neededobj1.so $(objpfx)neededobj2.so \
402 $(objpfx)neededobj3.so $(objpfx)neededobj4.so
9807e540 403
c77a4478
UD
404neededtest4-ENV = LC_ALL=C LANGUAGE=C
405$(objpfx)neededtest4: $(libdl) $(objpfx)neededobj1.so
406$(objpfx)neededtest4.out: $(objpfx)neededobj5.so $(objpfx)neededobj6.so
407
aaff4ba9 408$(objpfx)restest1: $(objpfx)testobj1.so $(objpfx)testobj1_1.so $(libdl)
e18db2b0 409LDFLAGS-restest1 = -rdynamic
6bd06384 410
2373b30e
UD
411$(objpfx)restest2: $(libdl)
412LDFLAGS-restest2 = -rdynamic
413
6bd06384 414$(objpfx)restest1.out: $(test-modules)
3d91edb2 415
e18db2b0 416preloadtest-preloads = testobj1 testobj2 testobj3 testobj4 testobj5
10584d2e 417$(objpfx)preloadtest: $(objpfx)testobj6.so
10584d2e 418LDFLAGS-preloadtest = -rdynamic
e18db2b0
UD
419$(objpfx)preloadtest.out: $(preloadtest-preloads:%=$(objpfx)%.so)
420preloadtest-ENV = \
421 LD_PRELOAD=$(subst $(empty) ,:,$(strip $(preloadtest-preloads:=.so)))
1e262312 422
aaff4ba9 423$(objpfx)loadfail: $(libdl)
1e262312
UD
424LDFLAGS-loadfail = -rdynamic
425
61e0617a
UD
426$(objpfx)loadfail.out: $(objpfx)failobj.so
427
428$(objpfx)multiload: $(libdl)
429LDFLAGS-multiload = -rdynamic
9df54168 430CFLAGS-multiload.c = -DOBJDIR=\"$(elf-objpfx)\"
61e0617a
UD
431
432$(objpfx)multiload.out: $(objpfx)testobj1.so
dc5efe83
UD
433
434$(objpfx)origtest: $(libdl)
394679eb 435LDFLAGS-origtest = -rdynamic
dc5efe83 436$(objpfx)origtest.out: $(objpfx)testobj1.so
ff5fad16
UD
437
438ifeq ($(have-thread-library),yes)
439$(objpfx)resolvfail: $(libdl) $(shared-thread-library)
440else
441$(objpfx)resolvfail: $(libdl)
442endif
19cf43be
UD
443
444$(objpfx)constload1: $(libdl)
445$(objpfx)constload1.out: $(objpfx)constload2.so $(objpfx)constload3.so
84ddc586 446
6d78cd00
UD
447$(objpfx)circleload1: $(libdl)
448$(objpfx)circleload1.out: $(objpfx)circlemod1.so \
449 $(objpfx)circlemod1a.so
450
451$(objpfx)circlemod1.so: $(objpfx)circlemod2.so
452$(objpfx)circlemod2.so: $(objpfx)circlemod3.so
453$(objpfx)circlemod1a.so: $(objpfx)circlemod2a.so
454$(objpfx)circlemod2a.so: $(objpfx)circlemod3a.so
455
84ddc586
UD
456$(objpfx)order: $(addprefix $(objpfx),dep4.so dep3.so dep2.so dep1.so)
457
458$(objpfx)order.out: $(objpfx)order
459 $(elf-objpfx)$(rtld-installed-name) \
460 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
461 $(objpfx)order > $@
462 (echo "0123456789" | cmp $@ -) > /dev/null
c1025c19
UD
463
464$(objpfx)vismain: $(addprefix $(objpfx),vismod1.so vismod2.so)
465$(objpfx)vismain.out: $(addprefix $(objpfx),vismod3.so)
466vismain-ENV = LD_PRELOAD=$(addprefix $(objpfx),vismod3.so)
5e61ef88
UD
467
468$(objpfx)noload: $(objpfx)testobj1.so
469LDFLAGS-noload = -rdynamic
470$(objpfx)noload.out: $(objpfx)testobj5.so
0fb7851f 471
ad7534c8 472LDFLAGS-nodelete = -rdynamic
0fb7851f 473LDFLAGS-nodelmod1.so = -Wl,--enable-new-dtags,-z,nodelete
2cb8cefb 474LDFLAGS-nodelmod4.so = -Wl,--enable-new-dtags,-z,nodelete
0fb7851f 475$(objpfx)nodelete: $(libdl)
2cb8cefb
UD
476$(objpfx)nodelete.out: $(objpfx)nodelmod1.so $(objpfx)nodelmod2.so \
477 $(objpfx)nodelmod3.so
2f54c82d
UD
478
479LDFLAGS-nodlopenmod.so = -Wl,--enable-new-dtags,-z,nodlopen
480$(objpfx)nodlopen: $(libdl)
481$(objpfx)nodlopen.out: $(objpfx)nodlopenmod.so
fcacb36a 482
87837aac
UD
483$(objpfx)nodlopenmod2.so: $(objpfx)nodlopenmod.so
484$(objpfx)nodlopen2: $(libdl)
485$(objpfx)nodlopen2.out: $(objpfx)nodlopenmod2.so
486
137bca87
UD
487$(objpfx)filtmod1.so: $(objpfx)filtmod1.os $(objpfx)filtmod2.so
488 $(LINK.o) -shared -o $@ -B$(csu-objpfx) $(LDFLAGS.so) \
489 -L$(subst :, -L,$(rpath-link)) \
490 -Wl,-rpath-link=$(rpath-link) \
491 $< -Wl,-F,$(objpfx)filtmod2.so
fcacb36a 492$(objpfx)filter: $(objpfx)filtmod1.so
2b7238dd
UD
493
494$(objpfx)unload: $(libdl)
495$(objpfx)unload.out: $(objpfx)unloadmod.so
496
497$(objpfx)reldep: $(libdl)
498$(objpfx)reldep.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod2.so
499
500$(objpfx)reldep2: $(libdl)
501$(objpfx)reldep2.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod3.so
502
503$(objpfx)reldep3: $(libdl)
504$(objpfx)reldep3.out: $(objpfx)reldepmod1.so $(objpfx)reldepmod4.so
917fd061 505
1826d793
UD
506$(objpfx)reldep4: $(libdl)
507$(objpfx)reldep4.out: $(objpfx)reldep4mod1.so $(objpfx)reldep4mod2.so
508
917fd061 509$(objpfx)next: $(objpfx)nextmod1.so $(objpfx)nextmod2.so $(libdl)
f6de2239
UD
510
511$(objpfx)unload2: $(libdl)
512$(objpfx)unload2.out: $(objpfx)unload2mod.so $(objpfx)unload2dep.so
d785c366
UD
513
514$(objpfx)lateglobal: $(libdl)
515$(objpfx)lateglobal.out: $(objpfx)ltglobmod1.so $(objpfx)ltglobmod2.so
5a384a91
UD
516
517$(objpfx)tst-pathopt: $(libdl)
518$(objpfx)tst-pathopt.out: tst-pathopt.sh $(objpfx)tst-pathopt \
519 $(objpfx)pathoptobj.so
520 $(SHELL) -e $< $(common-objpfx)
b71e7ce8
UD
521
522$(objpfx)initfirst: $(libdl)
523$(objpfx)initfirst.out: $(objpfx)firstobj.so
273a3cfb
UD
524
525$(objpfx)global: $(objpfx)globalmod1.so
526$(objpfx)global.out: $(objpfx)reldepmod1.so
3fac0001
UD
527
528$(objpfx)dblload: $(libdl)
529$(objpfx)dblload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so
530
531$(objpfx)dblunload: $(libdl)
532$(objpfx)dblunload.out: $(objpfx)dblloadmod1.so $(objpfx)dblloadmod2.so
c4bb124a
UD
533
534$(objpfx)reldep5: $(libdl)
535$(objpfx)reldep5.out: $(objpfx)reldepmod5.so $(objpfx)reldepmod5.so
c47e78b1
UD
536
537$(objpfx)reldep6: $(libdl)
538$(objpfx)reldep6.out: $(objpfx)reldep6mod3.so $(objpfx)reldep6mod4.so
2e36cb48 539
a41d8a74
UD
540$(objpfx)reldep7: $(libdl)
541$(objpfx)reldep7.out: $(objpfx)reldep7mod1.so $(objpfx)reldep7mod2.so
542
cfaf5e56
UD
543$(objpfx)reldep8: $(libdl)
544$(objpfx)reldep8.out: $(objpfx)reldep8mod3.so
545
aff4519d
UD
546LDFLAGS-nodel2mod2.so = -Wl,--enable-new-dtags,-z,nodelete
547$(objpfx)nodelete2: $(libdl)
548$(objpfx)nodelete2.out: $(objpfx)nodel2mod3.so
549
550$(objpfx)reldep9: $(libdl)
551$(objpfx)reldep9.out: $(objpfx)reldep9mod3.so
552
2e36cb48 553$(objpfx)tst-tls3: $(objpfx)tst-tlsmod1.so
aed283dd
UD
554
555$(objpfx)tst-tls4: $(libdl)
556$(objpfx)tst-tls4.out: $(objpfx)tst-tlsmod2.so
557
558$(objpfx)tst-tls5: $(libdl)
559$(objpfx)tst-tls5.out: $(objpfx)tst-tlsmod2.so
bb4cb252
UD
560
561$(objpfx)tst-tls6: $(libdl)
562$(objpfx)tst-tls6.out: $(objpfx)tst-tlsmod2.so
fc093be1
UD
563
564$(objpfx)tst-tls7: $(libdl)
565$(objpfx)tst-tls7.out: $(objpfx)tst-tlsmod3.so
ebda6173
UD
566
567$(objpfx)tst-tls8: $(libdl)
568$(objpfx)tst-tls8.out: $(objpfx)tst-tlsmod3.so $(objpfx)tst-tlsmod4.so
6ef518c3
RM
569
570$(objpfx)tst-tls9: $(libdl)
571$(objpfx)tst-tls9.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
572
573ifdef libdl
574$(objpfx)tst-tls9-static: $(common-objpfx)dlfcn/libdl.a
575$(objpfx)tst-tls9-static.out: $(objpfx)tst-tlsmod5.so $(objpfx)tst-tlsmod6.so
576endif
dfe4c900
RM
577
578$(objpfx)tst-array1.out: $(objpfx)tst-array1
579 $(elf-objpfx)$(rtld-installed-name) \
580 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
581 $(objpfx)tst-array1 > $@
582 cmp $@ tst-array1.exp > /dev/null
583
584$(objpfx)tst-array2: $(objpfx)tst-array2dep.so
585$(objpfx)tst-array2.out: $(objpfx)tst-array2
586 $(elf-objpfx)$(rtld-installed-name) \
587 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
588 $(objpfx)tst-array2 > $@
589 cmp $@ tst-array2.exp > /dev/null
590
591$(objpfx)tst-array3.out: $(objpfx)tst-array3
592 $(elf-objpfx)$(rtld-installed-name) \
593 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
594 $(objpfx)tst-array3 > $@
595 cmp $@ tst-array1.exp > /dev/null
efd56f53 596
62f29da7
UD
597$(objpfx)tst-array4: $(libdl)
598$(objpfx)tst-array4.out: $(objpfx)tst-array4 $(objpfx)tst-array2dep.so
599 $(elf-objpfx)$(rtld-installed-name) \
600 --library-path $(rpath-link)$(patsubst %,:%,$(sysdep-library-path)) \
601 $< > $@
602 cmp $@ tst-array4.exp > /dev/null
efd56f53
UD
603
604check-textrel-CFLAGS = -O
605$(objpfx)check-textrel: check-textrel.c
606 $(native-compile)
607
608ifeq (yes,$(build-shared))
609tests: $(objpfx)check-textrel.out
610
611$(objpfx)check-textrel.out: $(objpfx)check-textrel
612 $(dir $<)$(notdir $<) $(common-objpfx)libc.so \
b4c98dc4
UD
613 $(sort $(wildcard $(common-objpfx)*/lib*.so \
614 $(common-objpfx)iconvdata/*.so)) > $@
efd56f53
UD
615generated += check-textrel check-textrel.out
616endif
This page took 0.28601 seconds and 5 git commands to generate.