This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Adding custom sections to default linker script
- From: Jonas Maebe <jonas dot maebe at elis dot ugent dot be>
- To: binutils at sourceware dot org
- Date: Mon, 14 Sep 2015 09:29:43 +0200
- Subject: Re: Adding custom sections to default linker script
- Authentication-results: sourceware.org; auth=none
- References: <55E1BBA7 dot 7080202 at elis dot ugent dot be> <20150830132130 dot GA3518 at ratatosk> <55E33208 dot 8030602 at elis dot ugent dot be> <20150831095144 dot GA3518 at ratatosk> <55E80AE9 dot 5080603 at elis dot ugent dot be> <20150904122519 dot GC3455 at ratatosk> <55F5D809 dot 4010303 at elis dot ugent dot be> <20150913233120 dot GB7224 at bubble dot grove dot modra dot org>
On 14/09/15 01:31, Alan Modra wrote:
> No wonder it crashes. You have .fpcdata and .bss at the same address.
> This is because you told the linker to put .threadvar at _edata.
Ah, yes. The original linker script put the .fpc stuff inside .data, and
then .threadvar right after it. To keep the same layout, I added the
explicit placement for .threadvar. Then ld told me I couldn't insert
".data after .data" in my augmentation script, so I changed it to
.fpcdata, which in then caused the overlap (with ".data after .data", I
thought it would just put it at the end of the .data).
> Now
> it seems that .threadvar is empty and stripped from the output. If
> I'm remembering correctly, this explains why an old linker worked for
> you. Old linkers ignore address assignments to empty and stripped
> sections. Newer linkers don't, thus affecting following sections.
Perfect, now everything works!
Thanks again.
Jonas