yann@1310: --- glibc-2.7.OLD/elf/Makefile 2009-04-22 17:08:55.000000000 +0300 yann@1310: +++ glibc-2.7/elf/Makefile 2009-04-22 18:09:18.000000000 +0300 yann@1310: @@ -1,4 +1,4 @@ yann@1310: -# Copyright (C) 1995-2004, 2005, 2006, 2007 Free Software Foundation, Inc. yann@1310: +# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc. yann@1310: # This file is part of the GNU C Library. yann@1310: yann@1310: # The GNU C Library is free software; you can redistribute it and/or yann@1310: @@ -23,7 +23,7 @@ yann@1310: headers = elf.h bits/elfclass.h link.h bits/link.h yann@1310: routines = $(dl-routines) dl-support dl-iteratephdr \ yann@1310: dl-addr enbl-secure dl-profstub \ yann@1310: - dl-origin dl-libc dl-sym dl-tsd yann@1310: + dl-origin dl-libc dl-sym dl-tsd dl-sysdep yann@1310: yann@1310: # The core dynamic linking functions are in libc for the static and yann@1310: # profiled libraries. yann@1310: @@ -33,7 +33,8 @@ yann@1310: execstack caller open close trampoline) yann@1310: all-dl-routines = $(dl-routines) $(sysdep-dl-routines) yann@1310: # But they are absent from the shared libc, because that code is in ld.so. yann@1310: -elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin yann@1310: +elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \ yann@1310: + dl-sysdep yann@1310: shared-only-routines += dl-caller yann@1310: yann@1310: # ld.so uses those routines, plus some special stuff for being the program yann@1310: @@ -120,13 +121,6 @@ yann@1310: install-bin-script = ldd yann@1310: endif yann@1310: yann@1310: -ifeq (yes,$(build-static-nss)) yann@1310: -nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) yann@1310: -resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) yann@1310: -otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ yann@1310: - $(resolvobjdir)/libresolv.a yann@1310: -endif yann@1310: - yann@1310: others = sprof sln yann@1310: install-bin = sprof yann@1310: others-static = sln yann@1310: @@ -165,14 +159,14 @@ yann@1310: endif yann@1310: ifeq (yes,$(build-shared)) yann@1310: tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ yann@1310: - constload1 order $(tests-vis-$(have-protected)) noload filter unload \ yann@1310: + constload1 order vismain noload filter unload \ yann@1310: reldep reldep2 reldep3 reldep4 nodelete nodelete2 \ yann@1310: nodlopen nodlopen2 neededtest neededtest2 \ yann@1310: neededtest3 neededtest4 unload2 lateglobal initfirst global \ yann@1310: restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \ yann@1310: circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \ yann@1310: tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \ yann@1310: - tst-tls-dlinfo \ yann@1310: + tst-tls16 tst-tls17 tst-tls18 tst-tls-dlinfo \ yann@1310: tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \ yann@1310: tst-dlmodcount tst-dlopenrpath tst-deep1 \ yann@1310: tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \ yann@1310: @@ -181,16 +175,17 @@ yann@1310: tst-stackguard1 tst-addr1 tst-thrlock yann@1310: # reldep9 yann@1310: test-srcs = tst-pathopt yann@1310: -tests-vis-yes = vismain yann@1310: tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog yann@1310: endif yann@1310: ifeq (yesyes,$(have-fpie)$(build-shared)) yann@1310: tests: $(objpfx)tst-pie1.out yann@1310: endif yann@1310: tests: $(objpfx)tst-leaks1-mem yann@1310: +tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 yann@1310: +tlsmod18a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 yann@1310: modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \ yann@1310: testobj1_1 failobj constload2 constload3 unloadmod \ yann@1310: - dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \ yann@1310: + dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \ yann@1310: nodelmod1 nodelmod2 nodelmod3 nodelmod4 \ yann@1310: nodel2mod1 nodel2mod2 nodel2mod3 \ yann@1310: nodlopenmod nodlopenmod2 filtmod1 filtmod2 \ yann@1310: @@ -206,7 +201,10 @@ yann@1310: tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \ yann@1310: tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \ yann@1310: tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \ yann@1310: - tst-tlsmod15a tst-tlsmod15b \ yann@1310: + tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \ yann@1310: + $(patsubst %,tst-tlsmod17a%,$(tlsmod17a-suffixes)) \ yann@1310: + tst-tlsmod17b \ yann@1310: + $(patsubst %,tst-tlsmod18a%,$(tlsmod18a-suffixes)) \ yann@1310: circlemod1 circlemod1a circlemod2 circlemod2a \ yann@1310: circlemod3 circlemod3a \ yann@1310: reldep8mod1 reldep8mod2 reldep8mod3 \ yann@1310: @@ -226,7 +224,6 @@ yann@1310: ifeq (yesyes,$(have-fpie)$(build-shared)) yann@1310: modules-names += tst-piemod1 yann@1310: endif yann@1310: -modules-vis-yes = vismod1 vismod2 vismod3 yann@1310: modules-execstack-yes = tst-execstack-mod yann@1310: extra-test-objs += $(addsuffix .os,$(strip $(modules-names))) yann@1310: # We need this variable to be sure the test modules get the right CPPFLAGS. yann@1310: @@ -307,7 +304,7 @@ yann@1310: $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \ yann@1310: LC_ALL=C \ yann@1310: sed -e '/^=========/,/^=========/!d;/^=========/d' \ yann@1310: - -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \ yann@1310: + -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \ yann@1310: > $@.lds yann@1310: $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \ yann@1310: $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \ yann@1310: @@ -315,7 +312,7 @@ yann@1310: -Wl,-soname=$(rtld-installed-name) -T $@.lds yann@1310: rm -f $@.lds yann@1310: readelf -s $@ \ yann@1310: - | awk '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' yann@1310: + | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }' yann@1310: yann@1310: # interp.c exists just to get this string into the libraries. yann@1310: CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \ yann@1310: @@ -499,6 +496,7 @@ yann@1310: tst-tlsmod14a.so-no-z-defs = yes yann@1310: tst-tlsmod14b.so-no-z-defs = yes yann@1310: tst-tlsmod15a.so-no-z-defs = yes yann@1310: +tst-tlsmod16b.so-no-z-defs = yes yann@1310: circlemod2.so-no-z-defs = yes yann@1310: circlemod3.so-no-z-defs = yes yann@1310: circlemod3a.so-no-z-defs = yes yann@1310: @@ -718,6 +716,22 @@ yann@1310: yann@1310: yann@1310: yann@1310: +$(objpfx)tst-tls16: $(libdl) yann@1310: +$(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so yann@1310: + yann@1310: +$(objpfx)tst-tls17: $(libdl) yann@1310: +$(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so yann@1310: +$(patsubst %,$(objpfx)tst-tlsmod17a%.os,$(tlsmod17a-suffixes)): $(objpfx)tst-tlsmod17a%.os : tst-tlsmod17a.c yann@1310: + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ -DN=$* -DNOT_IN_libc=1 $< yann@1310: +$(patsubst %,$(objpfx)tst-tlsmod17a%.so,$(tlsmod17a-suffixes)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so yann@1310: +$(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)tst-tlsmod17a%.so,$(tlsmod17a-suffixes)) yann@1310: + yann@1310: +$(objpfx)tst-tls18: $(libdl) yann@1310: +$(objpfx)tst-tls18.out: $(patsubst %,$(objpfx)tst-tlsmod18a%.so,$(tlsmod18a-suffixes)) yann@1310: +$(patsubst %,$(objpfx)tst-tlsmod18a%.os,$(tlsmod18a-suffixes)): $(objpfx)tst-tlsmod18a%.os : tst-tlsmod18a.c yann@1310: + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ -DN=$* -DNOT_IN_libc=1 $< yann@1310: +$(patsubst %,$(objpfx)tst-tlsmod18a%.so,$(tlsmod18a-suffixes)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so yann@1310: + yann@1310: CFLAGS-tst-align.c = $(stack-align-test-flags) yann@1310: CFLAGS-tst-align2.c = $(stack-align-test-flags) yann@1310: CFLAGS-tst-alignmod.c = $(stack-align-test-flags) yann@1310: @@ -804,7 +818,7 @@ yann@1310: cmp $@ tst-array5-static.exp > /dev/null yann@1310: yann@1310: ifeq (yesyes,$(have-fpie)$(build-shared)) yann@1310: -CFLAGS-tst-pie1.c += -fpie yann@1310: +CFLAGS-tst-pie1.c += $(pie-ccflag) yann@1310: yann@1310: $(objpfx)tst-pie1.out: $(objpfx)tst-pie1 yann@1310: $(elf-objpfx)$(rtld-installed-name) \ yann@1310: @@ -845,10 +859,14 @@ yann@1310: $(objpfx)tst-dlmodcount.out: $(test-modules) yann@1310: yann@1310: check-data := $(firstword $(wildcard \ yann@1310: - $(patsubst %,../scripts/data/localplt-%.data,\ yann@1310: - $(addsuffix -$(config-os),\ yann@1310: - $(config-machine) $(base-machine))\ yann@1310: - generic))) yann@1310: + $(foreach D,$(add-ons) scripts,\ yann@1310: + $(patsubst %,$(..)$D/data/localplt-%.data,\ yann@1310: + $(abi-name) \ yann@1310: + $(addsuffix -$(config-os),\ yann@1310: + $(config-machine) \ yann@1310: + $(base-machine)) \ yann@1310: + generic)))) yann@1310: + yann@1310: tests: $(objpfx)check-localplt.out yann@1310: yann@1310: ifeq ($(have-thread-library),yes) yann@1310: @@ -857,9 +875,11 @@ yann@1310: yann@1310: $(objpfx)check-localplt.out: $(objpfx)check-localplt \ yann@1310: $(common-objpfx)libc.so \ yann@1310: - $(common-objpfx)math/libm.so $(thread-dso) \ yann@1310: - $(common-objpfx)rt/librt.so \ yann@1310: - $(common-objpfx)dlfcn/libdl.so \ yann@1310: + $(common-objpfx)math/libm.so $(thread-dso) \ yann@1310: + $(common-objpfx)rt/librt.so \ yann@1310: + $(common-objpfx)dlfcn/libdl.so \ yann@1310: + $(common-objpfx)resolv/libresolv.so \ yann@1310: + $(common-objpfx)crypt/libcrypt.so \ yann@1310: $(check-data) yann@1310: $(dir $<)$(notdir $<) $(filter-out $< $(check-data),$^) | \ yann@1310: LC_ALL=C sort | \