NOLOAD section attribute in gold.

Johan Karlsson Johan.Karlsson@enea.com
Mon Sep 14 09:21:00 GMT 2015


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



More information about the Binutils mailing list