This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Fix a number of PowerPC linker bugs
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Fri, 18 Mar 2005 09:24:06 +1030
- Subject: Re: Fix a number of PowerPC linker bugs
- References: <20050316023425.GF21148@bubble.modra.org>
On Wed, Mar 16, 2005 at 01:04:25PM +1030, Alan Modra wrote:
> o The PowerPC Embedded ABI says "Sections .sdata2 and .sbss2 shall not
> appear in a shared object file." We create a zero sized .sdata2 due
> to the silly way _SDA2_BASE_ is defined. So hide .sdata2 and .sbss2
> linker created input sections in .sdata and .sbss output sections.
Oops, talked about it but didn't post or commit the patch. HJ's
email about failing powerpc testcases should have woken me up..
* scripttempl/elf.sc: When CREATE_SHLIB, put .sdata2 and .sbss2
input sections into .sdata and .sbss output respectively.
Index: ld/scripttempl/elf.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elf.sc,v
retrieving revision 1.50
diff -u -p -r1.50 elf.sc
--- ld/scripttempl/elf.sc 26 Oct 2004 18:41:52 -0000 1.50
+++ ld/scripttempl/elf.sc 17 Mar 2005 22:33:26 -0000
@@ -120,6 +120,7 @@ if test -z "${NO_SMALL_DATA}"; then
{
${RELOCATING+PROVIDE (__sbss_start = .);}
${RELOCATING+PROVIDE (___sbss_start = .);}
+ ${CREATE_SHLIB+*(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)}
*(.dynsbss)
*(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
*(.scommon)
@@ -133,6 +134,7 @@ if test -z "${NO_SMALL_DATA}"; then
.sdata ${RELOCATING-0} :
{
${RELOCATING+${SDATA_START_SYMBOLS}}
+ ${CREATE_SHLIB+*(.sdata2 .sdata2.* .gnu.linkonce.s2.*)}
*(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
}"
SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
@@ -383,8 +385,6 @@ cat <<EOF
${RELOCATING+${OTHER_GOT_SYMBOLS}}
${NO_SMALL_DATA-${GOT}}
${OTHER_GOT_SECTIONS}
- ${CREATE_SHLIB+${SDATA2}}
- ${CREATE_SHLIB+${SBSS2}}
${SDATA}
${OTHER_SDATA_SECTIONS}
${RELOCATING+_edata = .;}
--
Alan Modra
IBM OzLabs - Linux Technology Centre