Adding custom sections to default linker script
Jonas Maebe
jonas.maebe@elis.ugent.be
Mon Sep 14 07:29:00 GMT 2015
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
More information about the Binutils
mailing list