[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>
Thu, 8 Dec 2016 11:48:47 +0000 (22:18 +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 8b99909..38fd9ea 100644 (file)
@@ -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>
index 068f5ca..87cb8bc 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;
   }