From 24ef2be9b6ca8276a62b3f60f845f4c8bb6194dd Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 2 Aug 2016 23:28:47 +0930 Subject: [PATCH] PowerPC64 ld segfault with code in non-executable sections PR ld/20428 * elf64-ppc.c (ppc_get_stub_entry): Don't segfault on NULL group. --- bfd/ChangeLog | 5 +++++ bfd/elf64-ppc.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1e08f3d..1230b1c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-08-02 Alan Modra + + PR ld/20428 + * elf64-ppc.c (ppc_get_stub_entry): Don't segfault on NULL group. + 2016-07-27 Nick Clifton * Import this patch from the mainline: diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index e06b576..d7af888 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -4505,6 +4505,8 @@ ppc_get_stub_entry (const asection *input_section, more than one stub used to reach say, printf, and we need to distinguish between them. */ group = htab->sec_info[input_section->id].u.group; + if (group == NULL) + return NULL; if (h != NULL && h->u.stub_cache != NULL && h->u.stub_cache->h == h -- 2.7.4