Page 1 of 1

ld: Sections overlapping

Posted: Thu Mar 19, 2009 7:46 am
by sebihepp
Hello,

What the hell is the ".eh_frame" section??? :?:

Code: Select all

ENTRY(start)
INPUT(bootloader.bin boot.bin)
OUTPUT(reserved.bin)
OUTPUT_FORMAT(binary)
SECTIONS
{
	TEXT 0x10000 : AT (0)
	{
		*(.text)
		*(.data)
		*(.bss)
		*(.rodata)
		FILL(0x00);
		. = ALIGN(1474560-512+0x10000);
	}
}
Error:
i586-elf-ld: section .eh_frame [00000 -> 00083] overlaps
section TEXT [00000 -> 167dff]

How can I make the linker just to ignore the ".eh_frame" section?

TIA
Sebihepp

Re: ld: Sections overlapping

Posted: Thu Mar 19, 2009 8:08 am
by neonek
The .eh_frame is for exception handling. You can /DISCARD/ : { *(.eh_frame) <sections to discard> }.

Regards,
Mark

Re: ld: Sections overlapping

Posted: Thu Mar 19, 2009 8:44 am
by sebihepp
I will try it as soon as I can. So .eh_frame us really used for exception handling?
And I thought I disabled exceptions by setting -fno-exceptions for g++. :oops:

And "/DISCARD/" includes all sections to ignore, right?

Thanks
Sebihepp

Re: ld: Sections overlapping

Posted: Thu Mar 19, 2009 10:15 am
by jal
sebihepp wrote:I will try it as soon as I can. So .eh_frame us really used for exception handling?
And I thought I disabled exceptions by setting -fno-exceptions for g++.
That should do the trick, yes. I would not discard any sections in the linker script: you should make sure your compiler does not create these sections in the first place.


JAL