This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
ld/emultempl/elf32.em place orphan patch for ia64-linux
- To: binutils at sources dot redhat dot com
- Subject: ld/emultempl/elf32.em place orphan patch for ia64-linux
- From: Jim Wilson <wilson at cygnus dot com>
- Date: Tue, 07 Nov 2000 12:07:42 -0800
This fixes an ia64-linux linker bug spotted when trying to link objects
produced by the Intel compiler. The Intel compiler emitted a .srdata section
with the small data and read only bits set. Since this isn't a predefined
section name, it became an orphaned section and was placed next to text
because the readonly bit was set. This resulted in out-of-range gp relative
relocations. A section with small data set needs to be put next to .sdata
regardless of what other bits are set.
2000-11-07 Jim Wilson <wilson@redhat.com>
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): New local
hold_sdata. If SEC_SMALL_DATA set, set place to hold_sdata.
Index: elf32.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/elf32.em,v
retrieving revision 1.36
diff -p -r1.36 elf32.em
*** elf32.em 2000/09/20 04:20:26 1.36
--- elf32.em 2000/11/07 19:59:49
*************** gld${EMULATION_NAME}_place_orphan (file,
*** 1008,1013 ****
--- 1008,1014 ----
static struct orphan_save hold_bss;
static struct orphan_save hold_rel;
static struct orphan_save hold_interp;
+ static struct orphan_save hold_sdata;
static int count = 1;
struct orphan_save *place;
lang_statement_list_type *old;
*************** gld${EMULATION_NAME}_place_orphan (file,
*** 1071,1076 ****
--- 1072,1080 ----
else if ((s->flags & SEC_HAS_CONTENTS) == 0
&& HAVE_SECTION (hold_bss, ".bss"))
place = &hold_bss;
+ else if ((s->flags & SEC_SMALL_DATA) != 0
+ && HAVE_SECTION (hold_sdata, ".sdata"))
+ place = &hold_sdata;
else if ((s->flags & SEC_READONLY) == 0
&& HAVE_SECTION (hold_data, ".data"))
place = &hold_data;