[patch][gold] Fix case where a empty section defines the segment of a following section

Rafael Espindola espindola@google.com
Mon May 17 19:05:00 GMT 2010


The attached patch fixes the case where a linker script defines the
segment a section should be in (.init in the test), but for a particular input
that section is empty.

Without this patch Output_section_definition::allocate_to_segment will not
set phdrs_list and the specified segment will not be used in the following
sections (.text in the test).

2010-05-17  Rafael Espindola  <espindola@google.com>

	* script-sections.cc (Output_section_definition::allocate_to_segment):
	Update the phdrs_list even when if the output section is NULL.
	* testsuite/Makefile.am: Add test.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/script_test_9.cc: New.
	* testsuite/script_test_9.sh: New.
	* testsuite/script_test_9.t: New.

Cheers,
-- 
Rafael Ávila de Espíndola
-------------- next part --------------
A non-text attachment was scrubbed...
Name: script.patch
Type: text/x-diff
Size: 6298 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20100517/26a54e7d/attachment.bin>


More information about the Binutils mailing list