From 4790d4b3cef58c4663f8b63bb1761e8494d323f5 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 8 Dec 2016 16:08:29 +1030 Subject: [PATCH] [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. --- gold/ChangeLog | 4 ++++ gold/powerpc.cc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 1fe7d03fdb9..65c62771507 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,6 +1,10 @@ 2017-02-22 Alan Modra Apply from master + 2016-12-08 Alan Modra + * powerpc.cc (Powerpc_relobj::stub_table): Return NULL rather + then asserting. + 2016-12-08 Alan Modra * options.h (--stub-group-multi): Fix typo. diff --git a/gold/powerpc.cc b/gold/powerpc.cc index 7d4a384ad8b..4d9e66911f2 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -292,8 +292,8 @@ public: = static_cast*>( parameters->sized_target()); 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; } -- 2.47.2