gold: powerpc: Test whether sym is not a plugin in do_gc_mark_symbol

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.
This commit is contained in:
Nikita Ermakov 2020-05-15 08:27:57 +09:30 committed by Alan Modra
parent 7813437494
commit 6a31512fd4
2 changed files with 5 additions and 1 deletions

View 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.

View 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());