From: David McCullough Date: Thu, 27 Nov 2008 01:08:04 +0000 (+0000) Subject: Kazu Hirata wrote: X-Git-Url: http://git.osdn.net/view?p=uclinux-h8%2Felf2flt.git;a=commitdiff_plain;h=74bc20707d99079535bba6b5068dd9df50aa62be Kazu Hirata wrote: > Attached is a patch to fix elf2flt.ld so that C++ programs will link > successfully. > > Nathan Sidwell says: > nathan@codesourcery.com > > "The problem is the .eh_frame_hdr optimization. firstly that input > section was not mentioned in the linker script and secondly, the > linker requires .eh_frame_hdr and .eh_frame section in the output, > so it can optimize them. I move gcc_except_table out of .data, for > consistency." I've been trying to get CVS binutils up and running on the Blackfin, and after debugging a C++ link failure I eventually tracked it down to the elf2flt linker script, and google pointed me at this thread which I'd completely forgotten in the meantime. The patch is needed, please apply to elf2flt. Bernd Schmidt --- diff --git a/elf2flt.ld b/elf2flt.ld index a16a9c8..19eab7c 100644 --- a/elf2flt.ld +++ b/elf2flt.ld @@ -59,9 +59,6 @@ R_RODAT *(.gnu.linkonce.r*) *(.data1) *(.data.*) *(.gnu.linkonce.d*) - *(.eh_frame_hdr) - *(.eh_frame) - *(.gcc_except_table) /* Microblaze has .sdata and .sbss (small bss). They must be contiguous, so please don't move any of this. JW */ @@ -134,10 +131,15 @@ SINGLE_LINK: KEEP (*(SORT(.dtors.*))) KEEP (*(SORT(.fini_array.*))) PROVIDE (__fini_array_end = .); - . = ALIGN(0x10) ; - _edata = . ; } > flatmem + .eh_frame_hdr : { *(.eh_frame_hdr) } > flatmem + .eh_frame : { KEEP(*(.eh_frame)) } > flatmem + .gcc_except_table : { KEEP(*(.gcc_except_table)) } >flatmem + + . = ALIGN(0x10) ; + _edata = . ; + .bss : { . = ALIGN(0x4) ; _sbss = ALIGN(0x4) ;