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>
Tue, 2 Aug 2016 14:09:09 +0000 (23:39 +0930)
PR ld/20428
* elf64-ppc.c (ppc_get_stub_entry): Don't segfault on NULL group.

bfd/ChangeLog
bfd/elf64-ppc.c

index 91764b7c56ac13dcb5996b959ecb158e8d04a330..753df715ef687905274be03b2181084011272077 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-08-02  Nick Clifton  <nickc@redhat.com>
 
        PR ld/17739
index 34d46359ab0738adaa9250a1e958aa6db05ff50f..f40b35ad0ea43c970f654ff06055d73a495e2cd7 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