linkonce sections, DWARF2 EH, and the ppc failures
Alan Modra
amodra@bigpond.net.au
Thu Jun 21 00:47:00 GMT 2001
On Wed, Jun 20, 2001 at 08:51:09AM -0700, Richard Henderson wrote:
> On Wed, Jun 20, 2001 at 03:42:03PM +0930, Alan Modra wrote:
> > Why do you think there would be one header per output file? The linker
> > is just stitching the .eh_frame* info back together in the order given
> > in input files. If you have one header per .o, they should all appear
> > in the output.
>
> No, all the .eh_frame1 sections will wind up together,
> then all the .eh_frame2 sections, etc.
Ah, but I was proposing a change to the linker scripts.
cat > z1.s <<EOF
.section .data1
.byte 1
.section .data2
.byte 2
.section .data3
.byte 3
.section .gnu.linkonce.d4
.byte 4
EOF
cat > z2.s <<EOF
.section .data1
.byte 0x11
.section .data2
.byte 0x12
.section .data3
.byte 0x13
.section .gnu.linkonce.d4
.byte 0x14
EOF
cat > z.lnk <<EOF
OUTPUT_FORMAT("elf32-i386", "elf32-i386",
"elf32-i386")
OUTPUT_ARCH(i386)
SECTIONS
{
.data :
{
*(.data* .gnu.linkonce.d*)
}
}
EOF
as -o z1.o z1.s
as -o z2.o z2.s
ld -T z.lnk -o z z1.o z2.o
objdump --full z
z: file format elf32-i386
Contents of section .data:
0000 01020300 11121300 04 .........
which almost works. There are two problems: padding, and the fact that
the linkonce section gets reordered.
Alan
More information about the Binutils
mailing list