2017-05-15 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>
Mon, 15 May 2017 22:59:52 +0000 (15:59 -0700)
        * layout.cc (Layout::segment_precedes): Add a case for testing
        pointer equality when determining which segment precedes
        another.

gold/ChangeLog
gold/layout.cc

index 0f1f4e54f2c668b878388e7d0af11652b70a9796..42bd6c30c1fddffab2456273c546f83c73634501 100644 (file)
@@ -1,3 +1,9 @@
+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-05-13  James Clarke  <jrtc27@jrtc27.com>
 
        PR gold/21444
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();
 
This page took 0.029475 seconds and 4 git commands to generate.