This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR 445: A64 linker complains short data segment overflowed


On Thu, Oct 14, 2004 at 12:01:37AM +0200, Jakub Jelinek wrote:
> On Wed, Oct 13, 2004 at 02:58:07PM -0700, H. J. Lu wrote:
> > Hi Jakub,
> > 
> > Your patch
> > 
> > http://sources.redhat.com/ml/binutils/2004-05/msg00143.html
> > 
> > caused
> > 
> > http://sources.redhat.com/bugzilla/show_bug.cgi?id=445
> 
> Any reason why it does that?  If really needed, can't it be done
> for IA-64 only?  The more sections protected with relro the better.
> 

It may be an icc bug. It will be fixed. Here is a patch for ia64 only.


H.J.
----
2004-10-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR 445
	* emulparams/elf64_ia64.sh (SMALL_DATA_CTOR): Set.
	(SMALL_DATA_DTOR): Set
	* scripttempl/elf.sc: If SMALL_DATA_CTOR is set, move .ctors
	after .data. If SMALL_DATA_DTOR is set, move .dtors after .data.

--- ld/emulparams/elf64_ia64.sh.small	2004-01-28 14:46:40.000000000 -0800
+++ ld/emulparams/elf64_ia64.sh	2004-10-13 15:26:06.640157876 -0700
@@ -33,3 +33,5 @@ test -n "$CREATE_PIE" && OTHER_GOT_RELOC
 OTHER_READONLY_SECTIONS="${OTHER_READONLY_SECTIONS}
   .IA_64.unwind_info ${RELOCATING-0} : { *(.IA_64.unwind_info${RELOCATING+* .gnu.linkonce.ia64unwi.*}) }
   .IA_64.unwind ${RELOCATING-0} : { *(.IA_64.unwind${RELOCATING+* .gnu.linkonce.ia64unw.*}) }"
+SMALL_DATA_CTOR=" "
+SMALL_DATA_DTOR=" "
--- ld/scripttempl/elf.sc.small	2004-10-04 10:29:49.000000000 -0700
+++ ld/scripttempl/elf.sc	2004-10-13 15:25:00.653677241 -0700
@@ -347,8 +347,8 @@ cat <<EOF
   .fini_array   ${RELOCATING-0} : { KEEP (*(.fini_array)) }
   ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
 
-  ${RELOCATING+${CTOR}}
-  ${RELOCATING+${DTOR}}
+  ${SMALL_DATA_CTOR-${RELOCATING+${CTOR}}}
+  ${SMALL_DATA_DTOR-${RELOCATING+${DTOR}}}
   .jcr          ${RELOCATING-0} : { KEEP (*(.jcr)) }
 
   ${RELOCATING+${DATARELRO}}
@@ -372,6 +372,8 @@ cat <<EOF
   .data1        ${RELOCATING-0} : { *(.data1) }
   ${WRITABLE_RODATA+${RODATA}}
   ${OTHER_READWRITE_SECTIONS}
+  ${SMALL_DATA_CTOR+${RELOCATING+${CTOR}}}
+  ${SMALL_DATA_DTOR+${RELOCATING+${DTOR}}}
   ${DATA_PLT+${PLT_BEFORE_GOT+${PLT}}}
   ${RELOCATING+${OTHER_GOT_SYMBOLS}}
   ${NO_SMALL_DATA-${GOT}}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]