[binutils-gdb] Sparc: use BFD_RELOC_<n>_PLT_PCREL in favor of custom types
Jan Beulich
jbeulich@sourceware.org
Mon Dec 15 09:51:41 GMT 2025
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=328b7ac3def806cfe758a61c79efc21b7218d9b9
commit 328b7ac3def806cfe758a61c79efc21b7218d9b9
Author: Jan Beulich <jbeulich@suse.com>
Date: Mon Dec 15 10:48:47 2025 +0100
Sparc: use BFD_RELOC_<n>_PLT_PCREL in favor of custom types
No reason to have separate types when the generic ones have no (other)
meaning for this target.
Diff:
---
bfd/bfd-in2.h | 2 --
bfd/elfxx-sparc.c | 4 ++--
bfd/libbfd.h | 2 --
bfd/reloc.c | 4 ----
gas/config/tc-sparc.c | 8 ++++----
5 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index caad47a4a62..bb5542a63df 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -3430,8 +3430,6 @@ enum bfd_reloc_code_real
BFD_RELOC_SPARC_6,
BFD_RELOC_SPARC_5,
#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
- BFD_RELOC_SPARC_PLT32,
- BFD_RELOC_SPARC_PLT64,
BFD_RELOC_SPARC_HIX22,
BFD_RELOC_SPARC_LOX10,
BFD_RELOC_SPARC_H44,
diff --git a/bfd/elfxx-sparc.c b/bfd/elfxx-sparc.c
index bd1dcf78b62..780122619a1 100644
--- a/bfd/elfxx-sparc.c
+++ b/bfd/elfxx-sparc.c
@@ -387,7 +387,7 @@ _bfd_sparc_elf_reloc_type_lookup (bfd *abfd,
case BFD_RELOC_SPARC_UA32:
return &_bfd_sparc_elf_howto_table[R_SPARC_UA32];
- case BFD_RELOC_SPARC_PLT32:
+ case BFD_RELOC_32_PLT_PCREL:
return &_bfd_sparc_elf_howto_table[R_SPARC_PLT32];
case BFD_RELOC_SPARC_10:
@@ -438,7 +438,7 @@ _bfd_sparc_elf_reloc_type_lookup (bfd *abfd,
case BFD_RELOC_SPARC_DISP64:
return &_bfd_sparc_elf_howto_table[R_SPARC_DISP64];
- case BFD_RELOC_SPARC_PLT64:
+ case BFD_RELOC_64_PLT_PCREL:
return &_bfd_sparc_elf_howto_table[R_SPARC_PLT64];
case BFD_RELOC_SPARC_HIX22:
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index 91cdee7fc4a..795241a6361 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -1174,8 +1174,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_SPARC_7",
"BFD_RELOC_SPARC_6",
"BFD_RELOC_SPARC_5",
- "BFD_RELOC_SPARC_PLT32",
- "BFD_RELOC_SPARC_PLT64",
"BFD_RELOC_SPARC_HIX22",
"BFD_RELOC_SPARC_LOX10",
"BFD_RELOC_SPARC_H44",
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 18f53e38255..9bf431a9f2f 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -1666,10 +1666,6 @@ ENUMX
ENUMEQX
BFD_RELOC_SPARC_DISP64
BFD_RELOC_64_PCREL
-ENUMX
- BFD_RELOC_SPARC_PLT32
-ENUMX
- BFD_RELOC_SPARC_PLT64
ENUMX
BFD_RELOC_SPARC_HIX22
ENUMX
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 65043af78d5..df475555557 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -3915,8 +3915,8 @@ tc_gen_reloc (asection *section, fixS *fixp)
case BFD_RELOC_16_PCREL:
case BFD_RELOC_32_PCREL:
case BFD_RELOC_64_PCREL:
- case BFD_RELOC_SPARC_PLT32:
- case BFD_RELOC_SPARC_PLT64:
+ case BFD_RELOC_32_PLT_PCREL:
+ case BFD_RELOC_64_PLT_PCREL:
case BFD_RELOC_VTABLE_ENTRY:
case BFD_RELOC_VTABLE_INHERIT:
case BFD_RELOC_SPARC_TLS_GD_HI22:
@@ -4904,8 +4904,8 @@ cons_fix_new_sparc (fragS *frag,
else if (*sparc_cons_special_reloc == 'p')
switch (nbytes)
{
- case 4: r = BFD_RELOC_SPARC_PLT32; break;
- case 8: r = BFD_RELOC_SPARC_PLT64; break;
+ case 4: r = BFD_RELOC_32_PLT_PCREL; break;
+ case 8: r = BFD_RELOC_64_PLT_PCREL; break;
}
else
switch (nbytes)
More information about the Binutils-cvs
mailing list