patches/glibc/2.7/300-binutils-_begin.patch
branchnewlib
changeset 1366 5e5d1e6f55d3
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.7/300-binutils-_begin.patch	Sun May 03 09:50:16 2009 +0000
     1.3 @@ -0,0 +1,190 @@
     1.4 +--- glibc-2.7.OLD/elf/Makefile	2009-04-22 17:08:55.000000000 +0300
     1.5 ++++ glibc-2.7/elf/Makefile	2009-04-22 18:09:18.000000000 +0300
     1.6 +@@ -1,4 +1,4 @@
     1.7 +-# Copyright (C) 1995-2004, 2005, 2006, 2007 Free Software Foundation, Inc.
     1.8 ++# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc.
     1.9 + # This file is part of the GNU C Library.
    1.10 + 
    1.11 + # The GNU C Library is free software; you can redistribute it and/or
    1.12 +@@ -23,7 +23,7 @@
    1.13 + headers		= elf.h bits/elfclass.h link.h bits/link.h
    1.14 + routines	= $(dl-routines) dl-support dl-iteratephdr \
    1.15 + 		  dl-addr enbl-secure dl-profstub \
    1.16 +-		  dl-origin dl-libc dl-sym dl-tsd
    1.17 ++		  dl-origin dl-libc dl-sym dl-tsd dl-sysdep
    1.18 + 
    1.19 + # The core dynamic linking functions are in libc for the static and
    1.20 + # profiled libraries.
    1.21 +@@ -33,7 +33,8 @@
    1.22 + 				  execstack caller open close trampoline)
    1.23 + all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
    1.24 + # But they are absent from the shared libc, because that code is in ld.so.
    1.25 +-elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin
    1.26 ++elide-routines.os = $(all-dl-routines) dl-support enbl-secure dl-origin \
    1.27 ++		    dl-sysdep
    1.28 + shared-only-routines += dl-caller
    1.29 + 
    1.30 + # ld.so uses those routines, plus some special stuff for being the program
    1.31 +@@ -120,13 +121,6 @@
    1.32 + install-bin-script = ldd
    1.33 + endif
    1.34 + 
    1.35 +-ifeq (yes,$(build-static-nss))
    1.36 +-nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
    1.37 +-resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv)
    1.38 +-otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \
    1.39 +-	     $(resolvobjdir)/libresolv.a
    1.40 +-endif
    1.41 +-
    1.42 + others		= sprof sln
    1.43 + install-bin	= sprof
    1.44 + others-static   = sln
    1.45 +@@ -165,14 +159,14 @@
    1.46 + endif
    1.47 + ifeq (yes,$(build-shared))
    1.48 + tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
    1.49 +-	 constload1 order $(tests-vis-$(have-protected)) noload filter unload \
    1.50 ++	 constload1 order vismain noload filter unload \
    1.51 + 	 reldep reldep2 reldep3 reldep4 nodelete nodelete2 \
    1.52 + 	 nodlopen nodlopen2 neededtest neededtest2 \
    1.53 + 	 neededtest3 neededtest4 unload2 lateglobal initfirst global \
    1.54 + 	 restest2 next dblload dblunload reldep5 reldep6 reldep7 reldep8 \
    1.55 + 	 circleload1 tst-tls3 tst-tls4 tst-tls5 tst-tls6 tst-tls7 tst-tls8 \
    1.56 + 	 tst-tls10 tst-tls11 tst-tls12 tst-tls13 tst-tls14 tst-tls15 \
    1.57 +-	 tst-tls-dlinfo \
    1.58 ++	 tst-tls16 tst-tls17 tst-tls18 tst-tls-dlinfo \
    1.59 + 	 tst-align tst-align2 $(tests-execstack-$(have-z-execstack)) \
    1.60 + 	 tst-dlmodcount tst-dlopenrpath tst-deep1 \
    1.61 + 	 tst-dlmopen1 tst-dlmopen2 tst-dlmopen3 \
    1.62 +@@ -181,16 +175,17 @@
    1.63 + 	 tst-stackguard1 tst-addr1 tst-thrlock
    1.64 + #	 reldep9
    1.65 + test-srcs = tst-pathopt
    1.66 +-tests-vis-yes = vismain
    1.67 + tests-execstack-yes = tst-execstack tst-execstack-needed tst-execstack-prog
    1.68 + endif
    1.69 + ifeq (yesyes,$(have-fpie)$(build-shared))
    1.70 + tests: $(objpfx)tst-pie1.out
    1.71 + endif
    1.72 + tests: $(objpfx)tst-leaks1-mem
    1.73 ++tlsmod17a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
    1.74 ++tlsmod18a-suffixes = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
    1.75 + modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
    1.76 + 		testobj1_1 failobj constload2 constload3 unloadmod \
    1.77 +-		dep1 dep2 dep3 dep4 $(modules-vis-$(have-protected)) \
    1.78 ++		dep1 dep2 dep3 dep4 vismod1 vismod2 vismod3 \
    1.79 + 		nodelmod1 nodelmod2 nodelmod3 nodelmod4 \
    1.80 + 		nodel2mod1 nodel2mod2 nodel2mod3 \
    1.81 + 		nodlopenmod nodlopenmod2 filtmod1 filtmod2 \
    1.82 +@@ -206,7 +201,10 @@
    1.83 + 		tst-tlsmod5 tst-tlsmod6 tst-tlsmod7 tst-tlsmod8 \
    1.84 + 		tst-tlsmod9 tst-tlsmod10 tst-tlsmod11 tst-tlsmod12 \
    1.85 + 		tst-tlsmod13 tst-tlsmod13a tst-tlsmod14a tst-tlsmod14b \
    1.86 +-		tst-tlsmod15a tst-tlsmod15b \
    1.87 ++		tst-tlsmod15a tst-tlsmod15b tst-tlsmod16a tst-tlsmod16b \
    1.88 ++		$(patsubst %,tst-tlsmod17a%,$(tlsmod17a-suffixes)) \
    1.89 ++		tst-tlsmod17b \
    1.90 ++		$(patsubst %,tst-tlsmod18a%,$(tlsmod18a-suffixes)) \
    1.91 + 		circlemod1 circlemod1a circlemod2 circlemod2a \
    1.92 + 		circlemod3 circlemod3a \
    1.93 + 		reldep8mod1 reldep8mod2 reldep8mod3 \
    1.94 +@@ -226,7 +224,6 @@
    1.95 + ifeq (yesyes,$(have-fpie)$(build-shared))
    1.96 + modules-names += tst-piemod1
    1.97 + endif
    1.98 +-modules-vis-yes = vismod1 vismod2 vismod3
    1.99 + modules-execstack-yes = tst-execstack-mod
   1.100 + extra-test-objs += $(addsuffix .os,$(strip $(modules-names)))
   1.101 + # We need this variable to be sure the test modules get the right CPPFLAGS.
   1.102 +@@ -307,7 +304,7 @@
   1.103 + 		  $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 |	\
   1.104 + 		  LC_ALL=C \
   1.105 + 		  sed -e '/^=========/,/^=========/!d;/^=========/d'	\
   1.106 +-		      -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
   1.107 ++		      -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
   1.108 + 		  > $@.lds
   1.109 + 	$(LINK.o) -nostdlib -nostartfiles -shared -o $@			\
   1.110 + 		  $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now))	\
   1.111 +@@ -315,7 +312,7 @@
   1.112 + 		  -Wl,-soname=$(rtld-installed-name) -T $@.lds
   1.113 + 	rm -f $@.lds
   1.114 + 	readelf -s $@ \
   1.115 +-	  | awk '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
   1.116 ++	  | $(AWK) '($$7 ~ /^UND(|EF)$$/ && $$1 != "0:" && $$4 != "REGISTER") { print; p=1 } END { exit p != 0 }'
   1.117 + 
   1.118 + # interp.c exists just to get this string into the libraries.
   1.119 + CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \
   1.120 +@@ -499,6 +496,7 @@
   1.121 + tst-tlsmod14a.so-no-z-defs = yes
   1.122 + tst-tlsmod14b.so-no-z-defs = yes
   1.123 + tst-tlsmod15a.so-no-z-defs = yes
   1.124 ++tst-tlsmod16b.so-no-z-defs = yes
   1.125 + circlemod2.so-no-z-defs = yes
   1.126 + circlemod3.so-no-z-defs = yes
   1.127 + circlemod3a.so-no-z-defs = yes
   1.128 +@@ -718,6 +716,22 @@
   1.129 + 
   1.130 + 
   1.131 + 
   1.132 ++$(objpfx)tst-tls16: $(libdl)
   1.133 ++$(objpfx)tst-tls16.out: $(objpfx)tst-tlsmod16a.so $(objpfx)tst-tlsmod16b.so
   1.134 ++
   1.135 ++$(objpfx)tst-tls17: $(libdl)
   1.136 ++$(objpfx)tst-tls17.out: $(objpfx)tst-tlsmod17b.so
   1.137 ++$(patsubst %,$(objpfx)tst-tlsmod17a%.os,$(tlsmod17a-suffixes)): $(objpfx)tst-tlsmod17a%.os : tst-tlsmod17a.c
   1.138 ++	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ -DN=$* -DNOT_IN_libc=1 $<
   1.139 ++$(patsubst %,$(objpfx)tst-tlsmod17a%.so,$(tlsmod17a-suffixes)): $(objpfx)tst-tlsmod17a%.so: $(objpfx)ld.so
   1.140 ++$(objpfx)tst-tlsmod17b.so: $(patsubst %,$(objpfx)tst-tlsmod17a%.so,$(tlsmod17a-suffixes))
   1.141 ++
   1.142 ++$(objpfx)tst-tls18: $(libdl)
   1.143 ++$(objpfx)tst-tls18.out: $(patsubst %,$(objpfx)tst-tlsmod18a%.so,$(tlsmod18a-suffixes))
   1.144 ++$(patsubst %,$(objpfx)tst-tlsmod18a%.os,$(tlsmod18a-suffixes)): $(objpfx)tst-tlsmod18a%.os : tst-tlsmod18a.c
   1.145 ++	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ -DN=$* -DNOT_IN_libc=1 $<
   1.146 ++$(patsubst %,$(objpfx)tst-tlsmod18a%.so,$(tlsmod18a-suffixes)): $(objpfx)tst-tlsmod18a%.so: $(objpfx)ld.so
   1.147 ++
   1.148 + CFLAGS-tst-align.c = $(stack-align-test-flags)
   1.149 + CFLAGS-tst-align2.c = $(stack-align-test-flags)
   1.150 + CFLAGS-tst-alignmod.c = $(stack-align-test-flags)
   1.151 +@@ -804,7 +818,7 @@
   1.152 + 	cmp $@ tst-array5-static.exp > /dev/null
   1.153 + 
   1.154 + ifeq (yesyes,$(have-fpie)$(build-shared))
   1.155 +-CFLAGS-tst-pie1.c += -fpie
   1.156 ++CFLAGS-tst-pie1.c += $(pie-ccflag)
   1.157 + 
   1.158 + $(objpfx)tst-pie1.out: $(objpfx)tst-pie1
   1.159 + 	$(elf-objpfx)$(rtld-installed-name) \
   1.160 +@@ -845,10 +859,14 @@
   1.161 + $(objpfx)tst-dlmodcount.out: $(test-modules)
   1.162 + 
   1.163 + check-data := $(firstword $(wildcard \
   1.164 +-	        $(patsubst %,../scripts/data/localplt-%.data,\
   1.165 +-			   $(addsuffix -$(config-os),\
   1.166 +-			   	       $(config-machine) $(base-machine))\
   1.167 +-			   generic)))
   1.168 ++	        $(foreach D,$(add-ons) scripts,\
   1.169 ++	        	  $(patsubst %,$(..)$D/data/localplt-%.data,\
   1.170 ++			   	     $(abi-name) \
   1.171 ++			   	     $(addsuffix -$(config-os),\
   1.172 ++				     		 $(config-machine) \
   1.173 ++						 $(base-machine)) \
   1.174 ++			   generic))))
   1.175 ++
   1.176 + tests: $(objpfx)check-localplt.out
   1.177 + 
   1.178 + ifeq ($(have-thread-library),yes)
   1.179 +@@ -857,9 +875,11 @@
   1.180 + 
   1.181 + $(objpfx)check-localplt.out: $(objpfx)check-localplt \
   1.182 + 			     $(common-objpfx)libc.so \
   1.183 +- 		    	     $(common-objpfx)math/libm.so $(thread-dso) \
   1.184 +- 		    	     $(common-objpfx)rt/librt.so \
   1.185 +- 		    	     $(common-objpfx)dlfcn/libdl.so \
   1.186 ++		    	     $(common-objpfx)math/libm.so $(thread-dso) \
   1.187 ++		    	     $(common-objpfx)rt/librt.so \
   1.188 ++		    	     $(common-objpfx)dlfcn/libdl.so \
   1.189 ++			     $(common-objpfx)resolv/libresolv.so \
   1.190 ++			     $(common-objpfx)crypt/libcrypt.so \
   1.191 + 			     $(check-data)
   1.192 + 	$(dir $<)$(notdir $<) $(filter-out $< $(check-data),$^) | \
   1.193 + 	  LC_ALL=C sort | \