From: Nick Clifton Date: Tue, 27 Oct 2020 16:23:09 +0000 (+0000) Subject: Fix seg-fault when running the ld testsuite for the hppa64-linux target. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27e5e547c7e30e9d78dd27662d7a8dc1373833cf;p=binutils-gdb.git Fix seg-fault when running the ld testsuite for the hppa64-linux target. * elf64-hppa.c (elf_hppa_final_link_relocate): Check that the symbol's section is being output before adding its offset to the addend when processing R_PARISC_SECREL32. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 931d4455ef5..d93b27bcede 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2020-10-27 Nick Clifton + + * elf64-hppa.c (elf_hppa_final_link_relocate): Check that the + symbol's section is being output before adding its offset to the + addend when processing R_PARISC_SECREL32. + 2020-10-25 Alan Modra * vms-misc.c (_bfd_vms_save_counted_string): Count length byte diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index bf8207e3a7a..50fd5a0deb9 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -3689,7 +3689,7 @@ elf_hppa_final_link_relocate (Elf_Internal_Rela *rel, } case R_PARISC_SECREL32: - if (sym_sec) + if (sym_sec && sym_sec->output_section) value -= sym_sec->output_section->vma; bfd_put_32 (input_bfd, value + addend, hit_data); return bfd_reloc_ok;