]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[GOLD] Don't assert in powerpc stub_table
authorAlan Modra <amodra@gmail.com>
Thu, 8 Dec 2016 05:38:29 +0000 (16:08 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 21 Feb 2017 23:10:22 +0000 (09:40 +1030)
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
gold/powerpc.cc

index 1fe7d03fdb98a9d6530627d4fb0d0d09d57c6a48..65c6277150799a20fbf1dd42b98963fcd098d492 100644 (file)
@@ -1,6 +1,10 @@
 2017-02-22  Alan Modra  <amodra@gmail.com>
 
        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.
 
index 7d4a384ad8b4dce244c83f7d552a745a24d1e992..4d9e66911f282b9b3f04231ef0f990d8c627c694 100644 (file)
@@ -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;
   }