From 328b7ac3def806cfe758a61c79efc21b7218d9b9 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 15 Dec 2025 10:48:47 +0100 Subject: [PATCH] Sparc: use BFD_RELOC__PLT_PCREL in favor of custom types No reason to have separate types when the generic ones have no (other) meaning for this target. --- 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) -- 2.47.3