]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
_bfd_elf_get_link_hash_entry tidy
authorAlan Modra <amodra@gmail.com>
Thu, 30 Oct 2025 05:56:44 +0000 (16:26 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 30 Oct 2025 05:56:44 +0000 (16:26 +1030)
commit57ccec66689305cdb59afa179b3f9a6464c84820
treeb768c8dde0793d92aef5c08352d5e4ab79de350c
parentad4b8c3e9586991795daf8358bee31335e412e56
_bfd_elf_get_link_hash_entry tidy

Replace the "Elf_Internal_Shdr *symtab_hdr" parameter with
"unsigned int ext_sym_start", making it a duplicate of the existing
get_link_hash_entry function.

Also remove unnecessary checks from get_ext_sym_hash_from_cookie and
find_merged_cie.  The sym_hashes and symbol index checks in
get_ext_sym_hash_from_cookie are duplicates of those done in
_bfd_elf_get_link_hash_entry, and there is no need to check for a
global symbol before calling _bfd_elf_get_link_hash_entry.  When
bad_symtab, local symbols will have a NULL sym_hashes entry.  Removing
these unnecessary checks gets rid of some cookie->locsyms references.

PR 33530
* elf-bfd.h (_bfd_elf_get_link_hash_entry): Update declaration.
* elflink.c (_bfd_elf_get_link_hash_entry): Rename from
get_link_hash_entry, adjusting all calls and deleting original
function.
(get_ext_sym_hash_from_cookie): Make "symndx" unsigned int.
Remove unnecessary check on sym_hashes, symbol index and
symbol binding.
* elf-eh-frame.c (find_merged_cie): Remove similar unnecessary
checks.
* elf64-x86-64.c (elf_x86_64_scan_relocs): Adjust.
* elfxx-x86.c (_bfd_x86_elf_check_relocs): Adjust.
(_bfd_x86_elf_link_relax_section): Adjust.
bfd/elf-bfd.h
bfd/elf-eh-frame.c
bfd/elf64-x86-64.c
bfd/elflink.c
bfd/elfxx-x86.c