aboutsummaryrefslogtreecommitdiff
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:17:27 +0930
commitd45d94d9484e5f22e1e414a17f8d4317f4f1ee37 (patch)
tree13f45564f5967371759f0bac25dec189ea383a2a
parent759ed377a2d5d8dae52985b9e56d2a4720841226 (diff)
downloadgdb-d45d94d9484e5f22e1e414a17f8d4317f4f1ee37.zip
gdb-d45d94d9484e5f22e1e414a17f8d4317f4f1ee37.tar.gz
gdb-d45d94d9484e5f22e1e414a17f8d4317f4f1ee37.tar.bz2
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 7619ab9..5b84a0b 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-06-29 Tristan Gingold <gingold@adacore.com>
* version.m4: Bump version to 2.26.2
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index aa6fe08..2b2b9d1 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -4504,6 +4504,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