This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] 2017-05-15 Eric Christopher <echristo at gmail dot com>


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0c38a3d1942067100580e9673bcf0cbe27f3d6e8

commit 0c38a3d1942067100580e9673bcf0cbe27f3d6e8
Author: Eric Christopher <echristo@gmail.com>
Date:   Mon May 15 15:59:52 2017 -0700

    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.

Diff:
---
 gold/ChangeLog | 6 ++++++
 gold/layout.cc | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index 0f1f4e5..42bd6c3 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -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
diff --git a/gold/layout.cc b/gold/layout.cc
index 07a3590..bb13d71 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -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();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]