The dot prefix used for R_PARISC_EPLT relocations causes issues
for symbol version support as no version section is defined for
these symbols. This causes the linker to exit with an error.
This change modifies the handling of EPLT relocations to use
offsets relative to a __text_seg base symbol. This symbol is
defined in the same way as the HP linker (a section symbol for
the .dynamic section).
This mostly fixes the symbol versioning support. There are
still issues caused by the munging of the value and section
of dynamic symbols. The value modifies the sorting of the
dynamic table by number. The section changes the type of
text symbols to data symbols. I don't think the section munging
is actually needed but that's an issue for another patch.
2025-10-26 John David Anglin <danglin@gcc.gnu.org>
bfd/ChangeLog:
* elf64-hppa.c (USE_DOT_ELPT_PREFIX): Define.
(struct elf_link_hash_entry): Add text_segment field.
(allocate_global_data_opd): Compute hppa_info.
Condition old dot prefix code on USE_DOT_ELPT_PREFIX.
Add new code to setup __text_seg hash table entry.
(elf64_hppa_finalize_opd): Check hh. Rework to output
relocation using __text_seg base.
(elf64_hppa_finish_dynamic_sections): Remove duplicate
comment.
(elf_hppa_final_link_relocate): Move code to initialize
the segment base values forward.