aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-06-28 20:46:31 +0930
committerAlan Modra <amodra@gmail.com>2016-06-28 20:46:31 +0930
commita01d012a5d3ed82cbe83b521298197e6ba59b590 (patch)
tree2e314e44579c34feb12744e1ed8950b317e679f1
parentcd484face85ad2724d62c81b84d9fb882701a250 (diff)
downloadgdb-a01d012a5d3ed82cbe83b521298197e6ba59b590.zip
gdb-a01d012a5d3ed82cbe83b521298197e6ba59b590.tar.gz
gdb-a01d012a5d3ed82cbe83b521298197e6ba59b590.tar.bz2
Fix ppc64le S-record test fail
Segfaults on --defsym symbol (__stack_chk_fail in this instance). * elf64-ppc.c (ppc64_elf_branch_reloc): Check for NULL owner before dereferencing.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf64-ppc.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f88580c..5430f0d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,12 @@
2016-06-28 Alan Modra <amodra@gmail.com>
+ Apply from master
+ 2016-05-19 Alan Modra <amodra@gmail.com>
+ * elf64-ppc.c (ppc64_elf_branch_reloc): Check for NULL owner
+ before dereferencing.
+
+2016-06-28 Alan Modra <amodra@gmail.com>
+
PR ld/19264
* elf64-ppc.c (STUB_SHRINK_ITER): Define.
(ppc64_elf_size_stubs): Exit stub sizing loop past STUB_SHRINK_ITER
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 8c6a14b..aa6fe08 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -2570,6 +2570,7 @@ ppc64_elf_branch_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol,
elf_symbol_type *elfsym = (elf_symbol_type *) symbol;
if (symbol->section->owner != abfd
+ && symbol->section->owner != NULL
&& abiversion (symbol->section->owner) >= 2)
{
unsigned int i;