gold patch committed: Fix handling of odd PHDRS clauses

Ian Lance Taylor iant@google.com
Wed Jun 29 00:41:00 GMT 2011


This patch fixes gold to handle odd PHDRS clauses which define two
segments which can not be distinguished: same flags, same address.
According to PR 12898 this happens when building kvm.  Committed to
mainline.

Ian


2011-06-28  Ian Lance Taylor  <iant@google.com>

	PR gold/12898
	* layout.cc (Layout::segment_precedes): Don't crash if a linker
	script create indistinguishable segments.
	(Layout::set_segment_offsets): Use stable_sort when sorting
	segments.  Pass this to Compare_segments constructor.
	* layout.h (class Layout): Make segment_precedes non-static.
	(class Compare_segments): Change from struct to class.  Add
	layout_ field.  Add constructor.
	* script-sections.cc
	(Script_sections::attach_sections_using_phdrs_clause): Rename
	local orphan to is_orphan.  Don't report failure to put empty
	section in segment.  On attachment failure, report name of
	section, and attach to first PT_LOAD segment.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 5162 bytes
Desc: patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20110629/5faac247/attachment.bin>


More information about the Binutils mailing list