[PATCH] gold: NOLOAD behavior compatible with GNU ld.

Johan Karlsson Johan.Karlsson@enea.com
Thu Sep 17 09:47:00 GMT 2015


Hi all,
This patch makes gold handle the NOLOAD section attribute in the same way GNU ld does for elf.

Instead of creating a SHT_PROGBITS with no flags section it creates one with SHT_NOBITS and SHF_ALLOC set. With this change all special handling of noload sections can be removed and all NOLOAD sections as handled as NOBITS.

2015-09-17  Johan Karlsson  <johan.karlsson@enea.com>

	NOLOAD section attribute compatible with GNU ld.

	* layout.cc (Layout::choose_output_section): Create NOLOAD sections as
	SHT_NOBITS and removed special handling of NOLOAD sections.
	(Layout::make_output_section_for_script): Create NOLOAD as SHT_NOBIT
	with SHF_ALLOC set.
	* output.cc (Output_section::Output_section): Removed member is_noload.
	(Output_section::do_reset_address_and_file_offset): Removed special
	handling of NOLOAD.
	* output.h (Output_section): Removed is_noload() and set_is_noload().
	removed member is_noload_.
	* script-sections.cc (Output_section_definition::set_section_addresses):
	removed special handling of NOLOAD.
	(Sort_output_sections::operator()): Removed sorting of NOLOAD sections.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gold_compatible_noload.patch
Type: application/octet-stream
Size: 5983 bytes
Desc: gold_compatible_noload.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20150917/d688b8e4/attachment.obj>


More information about the Binutils mailing list