aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-05-19 12:32:40 +0930
committerAlan Modra <amodra@gmail.com>2016-05-19 13:40:12 +0930
commit9f284bf9da3ecc689405cb7b698c7714acdf1ab0 (patch)
treef15d317dda38ee82178f87a1cb9432c066d04662 /bfd/elf64-ppc.c
parent6472871146e43446c43deaca0a8bb352b67f8f8e (diff)
downloadgdb-9f284bf9da3ecc689405cb7b698c7714acdf1ab0.zip
gdb-9f284bf9da3ecc689405cb7b698c7714acdf1ab0.tar.gz
gdb-9f284bf9da3ecc689405cb7b698c7714acdf1ab0.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.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 95d98eb..4f610d2 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;