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.
This commit is contained in:
Alan Modra 2016-05-19 12:32:40 +09:30
parent 6472871146
commit 9f284bf9da
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2016-05-19 Alan Modra <amodra@gmail.com>
* elf64-ppc.c (ppc64_elf_branch_reloc): Check for NULL owner
before dereferencing.
2016-05-18 Nick Clifton <nickc@redhat.com>
* po/sv.po: Updated Swedish translation.

View File

@ -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;