From 64da7fa527463f505bd085cd29cf57d8d5b6e8ef Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 10 Feb 2025 08:38:57 +0800 Subject: x86-64: Use x86_64_elf_howto_table for standard relocations For standard relocations, use x86_64_elf_howto_table, instead of calling elf_x86_64_rtype_to_howto. * elf64-x86-64.c (elf_x86_64_tls_transition): Use x86_64_elf_howto_table, instead of elf_x86_64_rtype_to_howto. (elf_x86_64_convert_load_reloc): Use x86_64_elf_howto_table, instead of elf_x86_64_rtype_to_howto, for R_X86_64_PC32. Signed-off-by: H.J. Lu --- bfd/elf64-x86-64.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index feb8827..9244f86 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1649,8 +1649,8 @@ elf_x86_64_tls_transition (struct bfd_link_info *info, bfd *abfd, { reloc_howto_type *from, *to; - from = elf_x86_64_rtype_to_howto (abfd, from_type); - to = elf_x86_64_rtype_to_howto (abfd, to_type); + from = &x86_64_elf_howto_table[from_type]; + to = &x86_64_elf_howto_table[to_type]; if (from == NULL || to == NULL) return false; @@ -2065,7 +2065,7 @@ elf_x86_64_convert_load_reloc (bfd *abfd, r_type = R_X86_64_PC32; /* Skip if the converted relocation will overflow. */ - howto = elf_x86_64_rtype_to_howto (abfd, r_type); + howto = &x86_64_elf_howto_table[r_type]; r = _bfd_final_link_relocate (howto, abfd, input_section, contents, irel->r_offset, relocation, raddend); @@ -2250,7 +2250,7 @@ elf_x86_64_convert_load_reloc (bfd *abfd, r_type = R_X86_64_PC32; /* Skip if the converted relocation will overflow. */ - howto = elf_x86_64_rtype_to_howto (abfd, r_type); + howto = &x86_64_elf_howto_table[r_type]; r = _bfd_final_link_relocate (howto, abfd, input_section, contents, irel->r_offset, relocation, -- cgit v1.1