]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
hppa64 root.u.def assertions
authorAlan Modra <amodra@gmail.com>
Wed, 21 Jan 2026 04:57:34 +0000 (15:27 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 21 Jan 2026 21:38:05 +0000 (08:08 +1030)
commit5fbaadcf9dd7ea5e3526cc0c7f683c13d9e31bba
treeedbf456035f264e43df3b51d7fd7524e29ccb1a1
parentb600229503b157c6f043fcaafcc0efe47c89d133
hppa64 root.u.def assertions

The aim here is to add assertions when root.u.def is accessed that
the field is valid, ie. we have a bfd_link_hash_defined or
bfd_link_hash_defweak symbol.  On doing so I found the assertion
triggering on one of the ld undefweak tests, fixed with the
elf64_hppa_finish_dynamic_symbol change.

The patch also refactors code using text_hash_entry and
data_hash_entry.

* elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Use zero
value for both undefined and undefweak symbols, and when
non-pic too.  Assert when accessing root.u.def that the symbol
is the correct type.
(elf64_hppa_finalize_opd, elf64_hppa_finalize_dlt),
(elf64_hppa_finalize_dynreloc): Similarly assert here.
(elf64_hppa_finalize_dlt): Move duplicate code involving
text_hash_entry and data_hash_entry out of conditionals.
(elf64_hppa_finalize_dynreloc, elf_hppa_dlt_dynrel_reloc),
(elf_hppa_final_link_relocate): Likewise.
bfd/elf64-hppa.c