From: Eric Christopher Date: Mon, 15 May 2017 22:59:52 +0000 (-0700) Subject: 2017-05-15 Eric Christopher X-Git-Tag: users/hjl/linux/release/2.28.51.0.1~1^2~34^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c38a3d1942067100580e9673bcf0cbe27f3d6e8;p=thirdparty%2Fbinutils-gdb.git 2017-05-15 Eric Christopher * layout.cc (Layout::segment_precedes): Add a case for testing pointer equality when determining which segment precedes another. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 0f1f4e54f2c..42bd6c30c1f 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2017-05-15 Eric Christopher + + * layout.cc (Layout::segment_precedes): Add a case for testing + pointer equality when determining which segment precedes + another. + 2017-05-13 James Clarke PR gold/21444 diff --git a/gold/layout.cc b/gold/layout.cc index 07a359074e0..bb13d7136e5 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();