This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[GOLD] Don't assert in powerpc stub_table
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 8 Dec 2016 22:18:19 +1030
- Subject: [GOLD] Don't assert in powerpc stub_table
- Authentication-results: sourceware.org; auth=none
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 --git a/gold/powerpc.cc b/gold/powerpc.cc
index 7750e11..2699723 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;
}
--
Alan Modra
Australia Development Lab, IBM