]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/ELF: fold BFD_RELOC_<arch>_IRELATIVE
authorJan Beulich <jbeulich@suse.com>
Mon, 15 Dec 2025 10:27:56 +0000 (11:27 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 15 Dec 2025 10:27:56 +0000 (11:27 +0100)
There's no need to have a separate reloc per arch; just like for other
more or less generic ones a single one will (mostly) do. Arm64, C-Sky, and
KVX - sadly - are exceptions.

bfd/bfd-in2.h
bfd/elf32-arm.c
bfd/elf32-i386.c
bfd/elf32-s390.c
bfd/elf64-s390.c
bfd/elf64-x86-64.c
bfd/elfxx-sparc.c
bfd/libbfd.h
bfd/reloc.c

index 0b9cdb996a046c7c9fac99b08293bbe50e8278ba..18f5cd960f880a679664b4155c475da0ea8092d1 100644 (file)
@@ -3323,6 +3323,7 @@ enum bfd_reloc_code_real
   BFD_RELOC_HI16_PLTOFF,
   BFD_RELOC_HI16_S_PLTOFF,
   BFD_RELOC_8_PLTOFF,
+  BFD_RELOC_IRELATIVE,
 
   /* Size relocations.  */
   BFD_RELOC_SIZE32,
@@ -3407,7 +3408,6 @@ enum bfd_reloc_code_real
   BFD_RELOC_SPARC_GOTDATA_OP_LOX10,
   BFD_RELOC_SPARC_GOTDATA_OP,
   BFD_RELOC_SPARC_JMP_IREL,
-  BFD_RELOC_SPARC_IRELATIVE,
 
   /* I think these are specific to SPARC a.out (e.g., Sun 4).  */
   BFD_RELOC_SPARC_BASE13,
@@ -3864,7 +3864,6 @@ enum bfd_reloc_code_real
   BFD_RELOC_386_TLS_GOTDESC,
   BFD_RELOC_386_TLS_DESC_CALL,
   BFD_RELOC_386_TLS_DESC,
-  BFD_RELOC_386_IRELATIVE,
   BFD_RELOC_386_GOT32X,
 
   /* x86-64/elf relocations.  */
@@ -3892,7 +3891,6 @@ enum bfd_reloc_code_real
   BFD_RELOC_X86_64_GOTPC32_TLSDESC,
   BFD_RELOC_X86_64_TLSDESC_CALL,
   BFD_RELOC_X86_64_TLSDESC,
-  BFD_RELOC_X86_64_IRELATIVE,
   BFD_RELOC_X86_64_PC32_BND,
   BFD_RELOC_X86_64_PLT32_BND,
   BFD_RELOC_X86_64_GOTPCRELX,
@@ -4261,9 +4259,6 @@ enum bfd_reloc_code_real
   /* Annotation of BX instructions.  */
   BFD_RELOC_ARM_V4BX,
 
-  /* ARM support for STT_GNU_IFUNC.  */
-  BFD_RELOC_ARM_IRELATIVE,
-
   /* Thumb1 relocations to support execute-only code.  */
   BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC,
   BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC,
@@ -5606,9 +5601,6 @@ enum bfd_reloc_code_real
   BFD_RELOC_390_GOTPLT20,
   BFD_RELOC_390_TLS_GOTIE20,
 
-  /* STT_GNU_IFUNC relocation.  */
-  BFD_RELOC_390_IRELATIVE,
-
   /* Score relocations.
      Low 16 bit for load/store.  */
   BFD_RELOC_SCORE_GPREL15,
index ba477dc6e47ecc961d4c545a8b2eb175348af25c..b3054b4efa52ddd75b96faddc91496bea47c701a 100644 (file)
@@ -2043,7 +2043,7 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
     {BFD_RELOC_ARM_TLS_TPOFF32,             R_ARM_TLS_TPOFF32},
     {BFD_RELOC_ARM_TLS_IE32,        R_ARM_TLS_IE32},
     {BFD_RELOC_ARM_TLS_LE32,        R_ARM_TLS_LE32},
-    {BFD_RELOC_ARM_IRELATIVE,       R_ARM_IRELATIVE},
+    {BFD_RELOC_IRELATIVE,           R_ARM_IRELATIVE},
     {BFD_RELOC_ARM_GOTFUNCDESC,      R_ARM_GOTFUNCDESC},
     {BFD_RELOC_ARM_GOTOFFFUNCDESC,   R_ARM_GOTOFFFUNCDESC},
     {BFD_RELOC_ARM_FUNCDESC,         R_ARM_FUNCDESC},
index dd2d49a263655cafa645977574a5cc3596ef4609..66a3a0aefa41cad719cf4d3cfbea1abe5444ca50 100644 (file)
@@ -322,8 +322,8 @@ elf_i386_reloc_type_lookup (bfd *abfd,
       TRACE ("BFD_RELOC_386_TLS_DESC");
       return &elf_howto_table[R_386_TLS_DESC - R_386_tls_offset];
 
-    case BFD_RELOC_386_IRELATIVE:
-      TRACE ("BFD_RELOC_386_IRELATIVE");
+    case BFD_RELOC_IRELATIVE:
+      TRACE ("BFD_RELOC_IRELATIVE");
       return &elf_howto_table[R_386_IRELATIVE - R_386_tls_offset];
 
     case BFD_RELOC_386_GOT32X:
index 80939c1c735d654a46414e2c0826d6b059d133f0..4c355f4db2ef1c16d4b21ce8bc91deead23af5d4 100644 (file)
@@ -289,7 +289,7 @@ elf_s390_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
       return &elf_howto_table[(int) R_390_GOTPLT20];
     case BFD_RELOC_390_TLS_GOTIE20:
       return &elf_howto_table[(int) R_390_TLS_GOTIE20];
-    case BFD_RELOC_390_IRELATIVE:
+    case BFD_RELOC_IRELATIVE:
       return &elf_howto_table[(int) R_390_IRELATIVE];
     case BFD_RELOC_VTABLE_INHERIT:
       return &elf32_s390_vtinherit_howto;
index 9e58bb21e707bd8fb6091954cf996f7fe9a69bee..d9192de79e4e91b6bdb9378424253e92cebe18c5 100644 (file)
@@ -317,7 +317,7 @@ elf_s390_reloc_type_lookup (bfd *abfd,
       return &elf_howto_table[(int) R_390_GOTPLT20];
     case BFD_RELOC_390_TLS_GOTIE20:
       return &elf_howto_table[(int) R_390_TLS_GOTIE20];
-    case BFD_RELOC_390_IRELATIVE:
+    case BFD_RELOC_IRELATIVE:
       return &elf_howto_table[(int) R_390_IRELATIVE];
     case BFD_RELOC_VTABLE_INHERIT:
       return &elf64_s390_vtinherit_howto;
index f39e0f66ba43e408e3f45ce93fb23afe41ae0cfd..f5ab6b8bddb1b6124ec41943b785c8c7b037904b 100644 (file)
@@ -266,7 +266,7 @@ static const struct elf_reloc_map x86_64_reloc_map[] =
   { BFD_RELOC_X86_64_GOTPC32_TLSDESC, R_X86_64_GOTPC32_TLSDESC, },
   { BFD_RELOC_X86_64_TLSDESC_CALL, R_X86_64_TLSDESC_CALL, },
   { BFD_RELOC_X86_64_TLSDESC,  R_X86_64_TLSDESC, },
-  { BFD_RELOC_X86_64_IRELATIVE,        R_X86_64_IRELATIVE, },
+  { BFD_RELOC_IRELATIVE,       R_X86_64_IRELATIVE, },
   { BFD_RELOC_X86_64_PC32_BND, R_X86_64_PC32_BND, },
   { BFD_RELOC_X86_64_PLT32_BND,        R_X86_64_PLT32_BND, },
   { BFD_RELOC_X86_64_GOTPCRELX, R_X86_64_GOTPCRELX, },
index 780122619a16a46a6311355cbc479c4ad6e04104..4edbd93174f64cc4f6b3aefdf726c8116c1a3dc1 100644 (file)
@@ -567,7 +567,7 @@ _bfd_sparc_elf_reloc_type_lookup (bfd *abfd,
     case BFD_RELOC_SPARC_JMP_IREL:
       return &sparc_jmp_irel_howto;
 
-    case BFD_RELOC_SPARC_IRELATIVE:
+    case BFD_RELOC_IRELATIVE:
       return &sparc_irelative_howto;
 
     case BFD_RELOC_VTABLE_INHERIT:
index e6bb146e7d0622700626b3e2008043a19e74f6f4..f5a08ebea18e7373172516d3ce3c94a4e2d7d838 100644 (file)
@@ -1099,6 +1099,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_HI16_PLTOFF",
   "BFD_RELOC_HI16_S_PLTOFF",
   "BFD_RELOC_8_PLTOFF",
+  "BFD_RELOC_IRELATIVE",
   "BFD_RELOC_SIZE32",
   "BFD_RELOC_SIZE64",
   "BFD_RELOC_68K_GLOB_DAT",
@@ -1157,7 +1158,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_SPARC_GOTDATA_OP_LOX10",
   "BFD_RELOC_SPARC_GOTDATA_OP",
   "BFD_RELOC_SPARC_JMP_IREL",
-  "BFD_RELOC_SPARC_IRELATIVE",
   "BFD_RELOC_SPARC_BASE13",
   "BFD_RELOC_SPARC_BASE22",
   "BFD_RELOC_SPARC_10",
@@ -1440,7 +1440,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_386_TLS_GOTDESC",
   "BFD_RELOC_386_TLS_DESC_CALL",
   "BFD_RELOC_386_TLS_DESC",
-  "BFD_RELOC_386_IRELATIVE",
   "BFD_RELOC_386_GOT32X",
   "BFD_RELOC_X86_64_GOT32",
   "BFD_RELOC_X86_64_COPY",
@@ -1466,7 +1465,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_X86_64_GOTPC32_TLSDESC",
   "BFD_RELOC_X86_64_TLSDESC_CALL",
   "BFD_RELOC_X86_64_TLSDESC",
-  "BFD_RELOC_X86_64_IRELATIVE",
   "BFD_RELOC_X86_64_PC32_BND",
   "BFD_RELOC_X86_64_PLT32_BND",
   "BFD_RELOC_X86_64_GOTPCRELX",
@@ -1757,7 +1755,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_ARM_LDC_SB_G1",
   "BFD_RELOC_ARM_LDC_SB_G2",
   "BFD_RELOC_ARM_V4BX",
-  "BFD_RELOC_ARM_IRELATIVE",
   "BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC",
   "BFD_RELOC_ARM_THUMB_ALU_ABS_G1_NC",
   "BFD_RELOC_ARM_THUMB_ALU_ABS_G2_NC",
@@ -2541,7 +2538,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_390_GOT20",
   "BFD_RELOC_390_GOTPLT20",
   "BFD_RELOC_390_TLS_GOTIE20",
-  "BFD_RELOC_390_IRELATIVE",
   "BFD_RELOC_SCORE_GPREL15",
   "BFD_RELOC_SCORE_DUMMY2",
   "BFD_RELOC_SCORE_JMP",
index 2fca454d26f36a2e283202c77fee817762fa1dc5..f85ec6da83e1a471fa785f15bc8e46c40e825c17 100644 (file)
@@ -1470,6 +1470,8 @@ ENUMX
   BFD_RELOC_HI16_S_PLTOFF
 ENUMX
   BFD_RELOC_8_PLTOFF
+ENUMX
+  BFD_RELOC_IRELATIVE
 ENUMDOC
   For ELF.
 
@@ -1619,8 +1621,6 @@ ENUMX
   BFD_RELOC_SPARC_GOTDATA_OP
 ENUMX
   BFD_RELOC_SPARC_JMP_IREL
-ENUMX
-  BFD_RELOC_SPARC_IRELATIVE
 ENUMDOC
   SPARC ELF relocations.  There is probably some overlap with other
   relocation types already defined.
@@ -2402,8 +2402,6 @@ ENUMX
   BFD_RELOC_386_TLS_DESC_CALL
 ENUMX
   BFD_RELOC_386_TLS_DESC
-ENUMX
-  BFD_RELOC_386_IRELATIVE
 ENUMX
   BFD_RELOC_386_GOT32X
 ENUMDOC
@@ -2457,8 +2455,6 @@ ENUMX
   BFD_RELOC_X86_64_TLSDESC_CALL
 ENUMX
   BFD_RELOC_X86_64_TLSDESC
-ENUMX
-  BFD_RELOC_X86_64_IRELATIVE
 ENUMX
   BFD_RELOC_X86_64_PC32_BND
 ENUMX
@@ -3141,11 +3137,6 @@ ENUM
 ENUMDOC
   Annotation of BX instructions.
 
-ENUM
-  BFD_RELOC_ARM_IRELATIVE
-ENUMDOC
-  ARM support for STT_GNU_IFUNC.
-
 ENUM
   BFD_RELOC_ARM_THUMB_ALU_ABS_G0_NC
 ENUMX
@@ -5305,11 +5296,6 @@ ENUMX
 ENUMDOC
   Long displacement extension.
 
-ENUM
-  BFD_RELOC_390_IRELATIVE
-ENUMDOC
-  STT_GNU_IFUNC relocation.
-
 ENUM
   BFD_RELOC_SCORE_GPREL15
 ENUMDOC