]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2017-06-21 Eric Christopher <echristo@gmail.com>
authorEric Christopher <echristo@gmail.com>
Mon, 15 May 2017 22:59:52 +0000 (15:59 -0700)
committerEric Christopher <echristo@gmail.com>
Wed, 21 Jun 2017 23:10:12 +0000 (16:10 -0700)
        Apply from master
        2017-05-15  Eric Christopher <echristo@gmail.com>

        * layout.cc (Layout::segment_precedes): Add a case for testing
        pointer equality when determining which segment precedes
        another.

gold/ChangeLog
gold/layout.cc

index 98adcbb2e9c6882bc9fdd83775e8113cca1403a2..4323d783ad3a53f0aa4cdb6dbad9d742c6653be2 100644 (file)
@@ -1,3 +1,12 @@
+2017-06-21  Eric Christopher  <echristo@gmail.com>
+
+       Apply from master
+       2017-05-15  Eric Christopher <echristo@gmail.com>
+
+        * layout.cc (Layout::segment_precedes): Add a case for testing
+        pointer equality when determining which segment precedes
+        another.
+
 2017-06-20  James Clarke  <jrtc27@jrtc27.com>
 
        * powerpc.cc (Stub_table::define_stub_syms): Always include object's
index 07a359074e0a0fcd729423b6fdfc201eeb6b2b0d..bb13d7136e512200ef6460736d2105bf7e24c9ab 100644 (file)
@@ -3300,6 +3300,11 @@ bool
 Layout::segment_precedes(const Output_segment* seg1,
                         const Output_segment* seg2)
 {
+  // In order to produce a stable ordering if we're called with the same pointer
+  // return false.
+  if (seg1 == seg2)
+    return false;
+
   elfcpp::Elf_Word type1 = seg1->type();
   elfcpp::Elf_Word type2 = seg2->type();