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.
This commit is contained in:
Nick Clifton 2020-10-27 16:23:09 +00:00
parent bcd213b2cf
commit 27e5e547c7
2 changed files with 7 additions and 1 deletions

View File

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

View File

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