PR 11899
authorNick Clifton <nickc@redhat.com>
Tue, 24 Aug 2010 07:24:10 +0000 (07:24 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 24 Aug 2010 07:24:10 +0000 (07:24 +0000)
        * layout.cc (segment_precedes): Sort segments by their physical
        addresses, if they have been set.

gold/ChangeLog
gold/layout.cc

index e2792b2dac2affa5fa6d4b42e09b18ef8746e571..c0396548b81f3e30333631fc5df78c230616aa54 100644 (file)
@@ -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
index 1dd41f3df28f4aa0e8cba54d0b34a81c7ed9a30d..3040bf6235e53f44ee86042870c66e343e09efb4 100644 (file)
@@ -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;
     }