This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] PowerPC64 ld segfault with code in non-executable sections
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 2 Aug 2016 14:21:47 -0000
- Subject: [binutils-gdb] PowerPC64 ld segfault with code in non-executable sections
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=89d77b8a520602832516ce6628ea930b4f0ccff4
commit 89d77b8a520602832516ce6628ea930b4f0ccff4
Author: Alan Modra <amodra@gmail.com>
Date: Tue Aug 2 23:28:47 2016 +0930
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.
Diff:
---
bfd/ChangeLog | 5 +++++
bfd/elf64-ppc.c | 2 ++
2 files changed, 7 insertions(+)
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 91764b7..753df71 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-08-02 Nick Clifton <nickc@redhat.com>
PR ld/17739
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 34d4635..f40b35a 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