aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2017-05-15 15:59:52 -0700
committerEric Christopher <echristo@gmail.com>2017-06-21 16:10:12 -0700
commitbf4b4662b33e136b27b7e9020f6b45de85d90494 (patch)
treeb706e6b964eb4d9a7e1c7db1d9c8793f10520673
parent3406c79335ef6fdffe46bae736afb4746f53866d (diff)
downloadgdb-bf4b4662b33e136b27b7e9020f6b45de85d90494.zip
gdb-bf4b4662b33e136b27b7e9020f6b45de85d90494.tar.gz
gdb-bf4b4662b33e136b27b7e9020f6b45de85d90494.tar.bz2
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.
-rw-r--r--gold/ChangeLog9
-rw-r--r--gold/layout.cc5
2 files changed, 14 insertions, 0 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 98adcbb..4323d78 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -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
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();