diff options
author | Alan Modra <amodra@gmail.com> | 2016-12-08 16:08:29 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-02-22 09:40:22 +1030 |
commit | 4790d4b3cef58c4663f8b63bb1761e8494d323f5 (patch) | |
tree | 3a1363de43aa027b6e2b6586a869494ae72794f8 | |
parent | f9b240971736450d8556b23c4ea4d7dd747b1b44 (diff) | |
download | gdb-4790d4b3cef58c4663f8b63bb1761e8494d323f5.zip gdb-4790d4b3cef58c4663f8b63bb1761e8494d323f5.tar.gz gdb-4790d4b3cef58c4663f8b63bb1761e8494d323f5.tar.bz2 |
[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.
-rw-r--r-- | gold/ChangeLog | 4 | ||||
-rw-r--r-- | gold/powerpc.cc | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 1fe7d03..65c6277 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -2,6 +2,10 @@ Apply from master 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 7d4a384..4d9e669 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; } |