Fix powerpc64 segfault caused by zero r_symndx relocs.
authorAlan Modra <amodra@gmail.com>
Wed, 2 Dec 2015 08:19:53 +0000 (18:49 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 2 Dec 2015 08:48:27 +0000 (19:18 +1030)
commitc27b8c2aeb369972f4f9f98f390607694c56a127
tree57157b60744cf9596ad4ee8981fd58275a290e1e
parent3395762edd7232d976179b232c93cd901b739367
Fix powerpc64 segfault caused by zero r_symndx relocs.

Fixes a segfault in ppc64_elf_tls_optimize found when testing
R_PPC64_ENTRY, and potential for trouble in other places found by
code inspection.

* elf64-ppc.c (ppc64_elf_tls_optimize): Don't segfault on NULL
symbol section or output section.
(ppc64_elf_edit_toc): Similarly for ld -R objects.
(ppc64_elf_size_stubs): Likewise.
bfd/ChangeLog
bfd/elf64-ppc.c