]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
hppa64: Mostly fix symbol versioning support
authorJohn David Anglin <danglin@gcc.gnu.org>
Sun, 26 Oct 2025 22:20:37 +0000 (18:20 -0400)
committerJohn David Anglin <danglin@gcc.gnu.org>
Sun, 26 Oct 2025 22:20:37 +0000 (18:20 -0400)
commit883e39544f5c65ff04eb18a40bf712dea8048693
tree459b49be65788d77888930f58bd0643050c81b31
parent42849ef824760a056bc785bea42e061d0d2e4916
hppa64: Mostly fix symbol versioning support

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.
bfd/elf64-hppa.c