hppa64: Fix some issues handling dynamic relocaltions
This change fixes the allocation logic in allocate_dynrel_entries and
elf64_hppa_finalize_dynreloc. It also fixes addend calculation for
segment based relocations.
Some applications now link successfully on HP-UX but there are still
issues with external weak symbols. This breaks linking with libgcc.
It looks like we need support for .rela.data.rel.ro, ...
2025-11-04 John David Anglin <danglin@gcc.gnu.org>
bfd/ChangeLog:
* elf64-hppa.c (allocate_dynrel_entries): Correct hh->want_opd
if condition.
(elf64_hppa_finalize_dynreloc): Likewise. Use symbol address
instead of OPD address. Include sec->output_offset in value2
calculation.
(elf64_hppa_finalize_opd): Likewise.
(elf64_hppa_finalize_dlt): Likewise.
(elf_hppa_final_link_relocate): Fix symbol address calculation.