From 9f284bf9da3ecc689405cb7b698c7714acdf1ab0 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 19 May 2016 12:32:40 +0930 Subject: [PATCH] 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. --- bfd/ChangeLog | 5 +++++ bfd/elf64-ppc.c | 1 + 2 files changed, 6 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index dac73e77f70..b475a139078 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2016-05-19 Alan Modra + + * elf64-ppc.c (ppc64_elf_branch_reloc): Check for NULL owner + before dereferencing. + 2016-05-18 Nick Clifton * po/sv.po: Updated Swedish translation. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 95d98eb49c1..4f610d2308d 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; -- 2.30.2