[binutils-gdb] s390: Simplify test for absolute symbol
Jens Remus
jremus@sourceware.org
Mon May 19 09:17:24 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c5c2cb6d7d92d4269c0e24bdfb7783fdddc94cfe
commit c5c2cb6d7d92d4269c0e24bdfb7783fdddc94cfe
Author: Jens Remus <jremus@linux.ibm.com>
Date: Mon May 19 11:16:53 2025 +0200
s390: Simplify test for absolute symbol
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>
Diff:
---
bfd/elf64-s390.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c
index 7964ec665b9..e758d087a61 100644
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -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
More information about the Binutils-cvs
mailing list