ld: Sections overlapping

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
sebihepp
Member
Member
Posts: 195
Joined: Tue Aug 26, 2008 11:24 am
GitHub: https://github.com/sebihepp

ld: Sections overlapping

Post 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
neonek
Member
Member
Posts: 38
Joined: Thu Aug 28, 2008 1:53 pm
Location: Białystok - Podlasie, Poland

Re: ld: Sections overlapping

Post by neonek »

The .eh_frame is for exception handling. You can /DISCARD/ : { *(.eh_frame) <sections to discard> }.

Regards,
Mark
Please correct my English. If you'll find mistake please tell me about it so I can improve my English.
sebihepp
Member
Member
Posts: 195
Joined: Tue Aug 26, 2008 11:24 am
GitHub: https://github.com/sebihepp

Re: ld: Sections overlapping

Post 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
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: ld: Sections overlapping

Post 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
Post Reply