From 6a31512fd4fdd38ee2b1ea78543d352f961ca172 Mon Sep 17 00:00:00 2001 From: Nikita Ermakov Date: Fri, 15 May 2020 08:27:57 +0930 Subject: [PATCH] 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. --- gold/ChangeLog | 4 ++++ gold/powerpc.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 212c9fac9da..e85669a9f4b 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,7 @@ +2020-05-15 Nikita Ermakov + + * powerpc.cc (do_gc_mark_symbol): Don't segfault on plugin symbols. + 2020-05-14 Nick Clifton * po/sr.po: New Serbian translation. diff --git a/gold/powerpc.cc b/gold/powerpc.cc index eae483212b8..2010c1e3d2b 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -9056,7 +9056,7 @@ Target_powerpc::do_gc_mark_symbol( Symbol_table* symtab, Symbol* sym) const { - if (size == 64) + if (size == 64 && sym->object()->pluginobj() == NULL) { Powerpc_relobj* ppc_object = static_cast*>(sym->object()); -- 2.30.2