]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
s390: Simplify test for absolute symbol
authorJens Remus <jremus@linux.ibm.com>
Mon, 19 May 2025 09:16:53 +0000 (11:16 +0200)
committerJens Remus <jremus@linux.ibm.com>
Mon, 19 May 2025 09:16:53 +0000 (11:16 +0200)
Simplify the test whether a symbol is absolute, by using the helper
bfd_is_abs_symbol.

bfd/
* elf64-s390.c (elf_s390_relocate_section): Use
bfd_is_abs_symbol to test whether symbol is absolute.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
bfd/elf64-s390.c

index 7964ec665b9e5bbdfa10ff5057ef2602e4b87ac0..e758d087a61bf71a0569b2555fddb567dc62aa49 100644 (file)
@@ -2276,8 +2276,6 @@ elf_s390_relocate_section (bfd *output_bfd,
                       || SYMBOL_REFERENCES_LOCAL (info, h)
                       || resolved_to_zero)
                {
-                 Elf_Internal_Sym *isym;
-
                  /* This is actually a static link, or it is a
                     -Bsymbolic link and the symbol is defined
                     locally, or the symbol was forced to be local
@@ -2317,9 +2315,7 @@ elf_s390_relocate_section (bfd *output_bfd,
                                  & 0xff00f000) == 0xe300c000
                              && bfd_get_8 (input_bfd,
                                            contents + rel->r_offset + 3) == 0x04))
-                     && (isym = bfd_sym_from_r_symndx (&htab->elf.sym_cache,
-                                                       input_bfd, r_symndx))
-                     && isym->st_shndx != SHN_ABS
+                     && !bfd_is_abs_symbol (&h->root)
                      && h != htab->elf.hdynamic
                      && h != htab->elf.hgot
                      && h != htab->elf.hplt