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] [GOLD] Don't assert in powerpc stub_table


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

commit 980d0cdd2fc40c30f3ddef644659d7d0dc00ed40
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Dec 8 16:08:29 2016 +1030

    [GOLD] Don't assert in powerpc stub_table
    
    A branch in a non-exec section that needs a stub can lead to this
    assertion.
    
    	* powerpc.cc (Powerpc_relobj::stub_table): Return NULL rather
    	then asserting.

Diff:
---
 gold/ChangeLog  | 5 +++++
 gold/powerpc.cc | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index 8b99909..38fd9ea 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,5 +1,10 @@
 2016-12-08  Alan Modra  <amodra@gmail.com>
 
+	* powerpc.cc (Powerpc_relobj::stub_table): Return NULL rather
+	then asserting.
+
+2016-12-08  Alan Modra  <amodra@gmail.com>
+
 	* options.h (--stub-group-multi): Fix typo.
 
 2016-12-07  Alan Modra  <amodra@gmail.com>
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 068f5ca..87cb8bc 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -292,8 +292,8 @@ public:
 	  = static_cast<Target_powerpc<size, big_endian>*>(
 	      parameters->sized_target<size, big_endian>());
 	unsigned int indx = this->stub_table_index_[shndx];
-	gold_assert(indx < target->stub_tables().size());
-	return target->stub_tables()[indx];
+	if (indx < target->stub_tables().size())
+	  return target->stub_tables()[indx];
       }
     return NULL;
   }


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