gold: powerpc: Test whether sym is not a plugin in do_gc_mark_symbol
authorNikita Ermakov <coffe92@gmail.com>
Thu, 14 May 2020 22:57:57 +0000 (08:27 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 14 May 2020 23:00:33 +0000 (08:30 +0930)
sym->object() could be either a Plugin or Powerpc_relobj. There could
be a situation when Pluginobj would be proccessed in
ppc_object->get_opd_ent(dst_off) as Powerpc_relobj and it leads to the
segmentation fault.

* powerpc.cc (do_gc_mark_symbol): Don't segfault on plugin symbols.

gold/ChangeLog
gold/powerpc.cc

index 212c9fac9da139e48df31aa4592836acb563bb32..e85669a9f4b3b2e2112ab32c9773b926ed49d407 100644 (file)
@@ -1,3 +1,7 @@
+2020-05-15  Nikita Ermakov  <coffe92@gmail.com>
+
+       * powerpc.cc (do_gc_mark_symbol): Don't segfault on plugin symbols.
+
 2020-05-14  Nick Clifton  <nickc@redhat.com>
 
        * po/sr.po: New Serbian translation.
index eae483212b8e890d459ab9bb0f26ee7b4ebaa775..2010c1e3d2b73e691e1e5cc02056f4dff4c8e57d 100644 (file)
@@ -9056,7 +9056,7 @@ Target_powerpc<size, big_endian>::do_gc_mark_symbol(
     Symbol_table* symtab,
     Symbol* sym) const
 {
-  if (size == 64)
+  if (size == 64 && sym->object()->pluginobj() == NULL)
     {
       Powerpc_relobj<size, big_endian>* ppc_object
        = static_cast<Powerpc_relobj<size, big_endian>*>(sym->object());
This page took 0.028529 seconds and 4 git commands to generate.