diff options
author | Nick Clifton <nickc@redhat.com> | 2020-10-27 16:23:09 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-10-27 16:23:09 +0000 |
commit | 27e5e547c7e30e9d78dd27662d7a8dc1373833cf (patch) | |
tree | 0501cfb846003ac97771205f5eae9478b90f8191 | |
parent | bcd213b2cfbca2df53fb7e5d187fd67ea8eb7185 (diff) | |
download | gdb-27e5e547c7e30e9d78dd27662d7a8dc1373833cf.zip gdb-27e5e547c7e30e9d78dd27662d7a8dc1373833cf.tar.gz gdb-27e5e547c7e30e9d78dd27662d7a8dc1373833cf.tar.bz2 |
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.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf64-hppa.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 931d445..d93b27b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2020-10-27 Nick Clifton <nickc@redhat.com> + + * 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 <amodra@gmail.com> * vms-misc.c (_bfd_vms_save_counted_string): Count length byte diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index bf8207e..50fd5a0 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; |