This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
NOLOAD section attribute in gold.
- From: Johan Karlsson <Johan dot Karlsson at enea dot com>
- To: Binutils <binutils at sourceware dot org>, "iant at google dot com" <iant at google dot com>, Cary Coutant <ccoutant at gmail dot com>
- Date: Mon, 14 Sep 2015 09:21:35 +0000
- Subject: NOLOAD section attribute in gold.
- Authentication-results: sourceware.org; auth=none
Been trying to using my old linker scripts with gold and smoked out a couple of bugs so most things work now, however there are still some strange things going on when using the NOLOAD section attribute.
It seems like NOLOAD means something different in gold compared to gnu ld.
In gnu ld NOLOAD is the same as NOBITS with allocate flag set, like bss. In gold I get PROGBITS without any flags set, see Layout::make_output_section_for_script(),
I've tried to change the behavior of this but make_output_section_for_script seems to create all sections that was not created during the linking phase, so there are some changes needed elsewhere for existing input sections.
Another problem seems to be that NOBITS section are still allocated in the elf, this happens with a simple linker script which only had text, data, and bss sections and no additional attributes.
So bss is uses memory in both in the elf and when creating a binary, this since filesize = memsize the the program header.
I'm willing to work on fixing this but I would like to discuss it first, because this behavior cannot be intended?
Regards,
Johan