diff options
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 6 | ||||
-rw-r--r-- | gold/layout.cc | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index e2792b2..c039654 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2010-08-24 Nick Clifton <nickc@redhat.com> + + PR 11899 + * layout.cc (segment_precedes): Sort segments by their physical + addresses, if they have been set. + 2010-08-23 Cary Coutant <ccoutant@google.com> * archive.cc (Lib_group::add_symbols): Lock object before deleting its diff --git a/gold/layout.cc b/gold/layout.cc index 1dd41f3..3040bf6 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -2457,8 +2457,13 @@ Layout::segment_precedes(const Output_segment* seg1, if (section_count1 > 0 && section_count2 == 0) return false; - uint64_t paddr1 = seg1->first_section_load_address(); - uint64_t paddr2 = seg2->first_section_load_address(); + uint64_t paddr1 = (seg1->are_addresses_set() + ? seg1->paddr() + : seg1->first_section_load_address()); + uint64_t paddr2 = (seg2->are_addresses_set() + ? seg2->paddr() + : seg2->first_section_load_address()); + if (paddr1 != paddr2) return paddr1 < paddr2; } |