This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Fix ld for ELF/PPC
On Mon, Sep 30, 2002 at 09:12:03AM +0200, Jakub Jelinek wrote:
> On Mon, Sep 30, 2002 at 11:00:26AM +0930, Alan Modra wrote:
> > * emultempl/elf32.em (output_rel_find): Always place orphan loadable
> > reloc sections just before .rel.plt/.rela.plt.
>
> Shouldn't the ".plt" be replaced by some macro, defaulting to ".plt" but
> changeable by target scripts?
> E.g. IA-64 names that section .rela.IA-64.pltoff, some other arch might
> have another confusing name.
Any target using elf.sc should be OK, because the script specifies
.rel.plt and .rela.plt before the special names and we're looking
at output_section_statement entries. ie. what is specified by the
script, not bfd sections.
Looking at the other scripts, I see elfd30v.sc would break except this
target is rela.. elfi370.sc is probably broken too, but I guess no
one cares. elfm68hc11.sc breaks because .rela.plt comes before a
whole lot of .rel sections, if any of them are used that is. Same for
the hc12 script. xstorm16y.sc doesn't have any reloc sections, but I
suppose that doesn't matter as the target doesn't support shared libs.
Committing the following to clean up a few scripts.
ld/ChangeLog
* scripttempl/elfd30v.sc: Order reloc sections placing .plt last.
* scripttempl/elfm68hc11.sc: Likewise.
* scripttempl/elfm68hc12.sc: Likewise.
Index: ld/scripttempl/elfd30v.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elfd30v.sc,v
retrieving revision 1.5
diff -u -p -r1.5 elfd30v.sc
--- ld/scripttempl/elfd30v.sc 12 Aug 2001 20:19:48 -0000 1.5
+++ ld/scripttempl/elfd30v.sc 30 Sep 2002 09:27:18 -0000
@@ -58,44 +58,44 @@ SECTIONS
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
+ .rel.text ${RELOCATING-0} : { *(.rel.text) *(.rel.gnu.linkonce.t*) }
.rela.text ${RELOCATING-0} : { *(.rela.text) *(.rela.gnu.linkonce.t*) }
+ .rel.data ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
.rela.data ${RELOCATING-0} : { *(.rela.data) *(.rela.gnu.linkonce.d*) }
+ .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
.rela.rodata ${RELOCATING-0} : { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
+ .rel.stext ${RELOCATING-0} : { *(.rel.stest) }
.rela.stext ${RELOCATING-0} : { *(.rela.stest) }
+ .rel.etext ${RELOCATING-0} : { *(.rel.etest) }
.rela.etext ${RELOCATING-0} : { *(.rela.etest) }
+ .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata) }
+ .rel.edata ${RELOCATING-0} : { *(.rel.edata) }
.rela.edata ${RELOCATING-0} : { *(.rela.edata) }
+ .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) }
.rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) }
- .rela.sbss ${RELOCATING-0} : { *(.rela.sbss) }
- .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) }
- .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) }
- .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) }
- .rela.got ${RELOCATING-0} : { *(.rela.got) }
- .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
- .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
- .rela.init ${RELOCATING-0} : { *(.rela.init) }
- .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
- .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
- .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
-
- .rel.data ${RELOCATING-0} : { *(.rel.data) *(.rel.gnu.linkonce.d*) }
- .rel.rodata ${RELOCATING-0} : { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
- .rel.stext ${RELOCATING-0} : { *(.rel.stest) }
- .rel.etext ${RELOCATING-0} : { *(.rel.etest) }
- .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) }
- .rel.edata ${RELOCATING-0} : { *(.rel.edata) }
.rel.sbss ${RELOCATING-0} : { *(.rel.sbss) }
+ .rela.sbss ${RELOCATING-0} : { *(.rela.sbss) }
.rel.ebss ${RELOCATING-0} : { *(.rel.ebss) }
- .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) }
+ .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) }
.rel.srodata ${RELOCATING-0} : { *(.rel.srodata) }
+ .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) }
.rel.erodata ${RELOCATING-0} : { *(.rel.erodata) }
+ .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) }
.rel.got ${RELOCATING-0} : { *(.rel.got) }
+ .rela.got ${RELOCATING-0} : { *(.rela.got) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
+ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
+ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
.rel.init ${RELOCATING-0} : { *(.rel.init) }
+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) }
+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
.rel.bss ${RELOCATING-0} : { *(.rel.bss) }
+ .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
+ .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
.init ${RELOCATING-0} : { *(.init) } =${NOP-0}
${DATA_PLT-${PLT}}
Index: ld/scripttempl/elfm68hc11.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elfm68hc11.sc,v
retrieving revision 1.8
diff -u -p -r1.8 elfm68hc11.sc
--- ld/scripttempl/elfm68hc11.sc 29 Jun 2002 10:33:45 -0000 1.8
+++ ld/scripttempl/elfm68hc11.sc 30 Sep 2002 09:27:19 -0000
@@ -264,35 +264,34 @@ SECTIONS
${RELOCATING+*(.rela.bss.*)}
${RELOCATING+*(.rela.gnu.linkonce.b.*)}
}
+ .rel.stext ${RELOCATING-0} : { *(.rel.stest) }
.rela.stext ${RELOCATING-0} : { *(.rela.stest) }
+ .rel.etext ${RELOCATING-0} : { *(.rel.etest) }
.rela.etext ${RELOCATING-0} : { *(.rela.etest) }
+ .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata) }
+ .rel.edata ${RELOCATING-0} : { *(.rel.edata) }
.rela.edata ${RELOCATING-0} : { *(.rela.edata) }
+ .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) }
.rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) }
- .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) }
- .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) }
- .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) }
- .rela.got ${RELOCATING-0} : { *(.rela.got) }
- .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
- .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
- .rela.init ${RELOCATING-0} : { *(.rela.init) }
- .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
- .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
-
- .rel.stext ${RELOCATING-0} : { *(.rel.stest) }
- .rel.etext ${RELOCATING-0} : { *(.rel.etest) }
- .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) }
- .rel.edata ${RELOCATING-0} : { *(.rel.edata) }
.rel.ebss ${RELOCATING-0} : { *(.rel.ebss) }
- .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) }
+ .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) }
.rel.srodata ${RELOCATING-0} : { *(.rel.srodata) }
+ .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) }
.rel.erodata ${RELOCATING-0} : { *(.rel.erodata) }
+ .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) }
.rel.got ${RELOCATING-0} : { *(.rel.got) }
+ .rela.got ${RELOCATING-0} : { *(.rela.got) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
+ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
+ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
.rel.init ${RELOCATING-0} : { *(.rel.init) }
+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) }
+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
+ .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
/* Concatenate .page0 sections. Put them in the page0 memory bank
unless we are creating a relocatable file. */
Index: ld/scripttempl/elfm68hc12.sc
===================================================================
RCS file: /cvs/src/src/ld/scripttempl/elfm68hc12.sc,v
retrieving revision 1.8
diff -u -p -r1.8 elfm68hc12.sc
--- ld/scripttempl/elfm68hc12.sc 29 Jun 2002 10:33:45 -0000 1.8
+++ ld/scripttempl/elfm68hc12.sc 30 Sep 2002 09:27:19 -0000
@@ -263,35 +263,34 @@ SECTIONS
${RELOCATING+*(.rela.bss.*)}
${RELOCATING+*(.rela.gnu.linkonce.b.*)}
}
+ .rel.stext ${RELOCATING-0} : { *(.rel.stest) }
.rela.stext ${RELOCATING-0} : { *(.rela.stest) }
+ .rel.etext ${RELOCATING-0} : { *(.rel.etest) }
.rela.etext ${RELOCATING-0} : { *(.rela.etest) }
+ .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) }
.rela.sdata ${RELOCATING-0} : { *(.rela.sdata) }
+ .rel.edata ${RELOCATING-0} : { *(.rel.edata) }
.rela.edata ${RELOCATING-0} : { *(.rela.edata) }
+ .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) }
.rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) }
- .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) }
- .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) }
- .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) }
- .rela.got ${RELOCATING-0} : { *(.rela.got) }
- .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
- .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
- .rela.init ${RELOCATING-0} : { *(.rela.init) }
- .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
- .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
-
- .rel.stext ${RELOCATING-0} : { *(.rel.stest) }
- .rel.etext ${RELOCATING-0} : { *(.rel.etest) }
- .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) }
- .rel.edata ${RELOCATING-0} : { *(.rel.edata) }
.rel.ebss ${RELOCATING-0} : { *(.rel.ebss) }
- .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) }
+ .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) }
.rel.srodata ${RELOCATING-0} : { *(.rel.srodata) }
+ .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) }
.rel.erodata ${RELOCATING-0} : { *(.rel.erodata) }
+ .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) }
.rel.got ${RELOCATING-0} : { *(.rel.got) }
+ .rela.got ${RELOCATING-0} : { *(.rela.got) }
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
+ .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
+ .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
.rel.init ${RELOCATING-0} : { *(.rel.init) }
+ .rela.init ${RELOCATING-0} : { *(.rela.init) }
.rel.fini ${RELOCATING-0} : { *(.rel.fini) }
+ .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
+ .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
/* Concatenate .page0 sections. Put them in the page0 memory bank
unless we are creating a relocatable file. */
--
Alan Modra
IBM OzLabs - Linux Technology Centre