PowerPC64 ld segfault with code in non-executable sections
authorAlan Modra <amodra@gmail.com>
Tue, 2 Aug 2016 13:58:47 +0000 (23:28 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 3 Aug 2016 05:46:20 +0000 (15:16 +0930)
PR ld/20428
* elf64-ppc.c (ppc_get_stub_entry): Don't segfault on NULL group.

bfd/ChangeLog
bfd/elf64-ppc.c

index 1e08f3d..1230b1c 100644 (file)
@@ -1,3 +1,8 @@
+2016-08-02  Alan Modra  <amodra@gmail.com>
+
+       PR ld/20428
+       * elf64-ppc.c (ppc_get_stub_entry): Don't segfault on NULL group.
+
 2016-07-27  Nick Clifton  <nickc@redhat.com>
 
        * Import this patch from the mainline:
index e06b576..d7af888 100644 (file)
@@ -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