aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2017-05-15 15:59:52 -0700
committerEric Christopher <echristo@gmail.com>2017-05-15 15:59:52 -0700
commit0c38a3d1942067100580e9673bcf0cbe27f3d6e8 (patch)
treed313b6eb4d07afba3c2ec57a31589b1581621c6e /gold/layout.cc
parentd8cbc93b65ace8a36002839d5ee944efff59d643 (diff)
downloadfsf-binutils-gdb-0c38a3d1942067100580e9673bcf0cbe27f3d6e8.zip
fsf-binutils-gdb-0c38a3d1942067100580e9673bcf0cbe27f3d6e8.tar.gz
fsf-binutils-gdb-0c38a3d1942067100580e9673bcf0cbe27f3d6e8.tar.bz2
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.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc5
1 files changed, 5 insertions, 0 deletions
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();