summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-08-02 23:28:47 +0930
committerAlan Modra <amodra@gmail.com>2016-08-03 15:16:20 +0930
commit24ef2be9b6ca8276a62b3f60f845f4c8bb6194dd (patch)
treee0b424c602d90dff47b1a7c4ba498f7145babdd8
parent15b8aefa8c307b0b25179ad068499f3097b28264 (diff)
downloadbinutils-24ef2be9b6ca8276a62b3f60f845f4c8bb6194dd.tar.gz
binutils-24ef2be9b6ca8276a62b3f60f845f4c8bb6194dd.tar.bz2
binutils-24ef2be9b6ca8276a62b3f60f845f4c8bb6194dd.zip
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.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-ppc.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1e08f3d287a..1230b1c4204 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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:
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index e06b57628fa..d7af888a2d4 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