]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Arc: use generic BFD_RELOC_... in favor of custom types
authorJan Beulich <jbeulich@suse.com>
Mon, 15 Dec 2025 09:48:26 +0000 (10:48 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 15 Dec 2025 09:48:26 +0000 (10:48 +0100)
No reason to have separate types when the generic ones have no (other)
meaning for this target.

bfd/bfd-in2.h
bfd/elf32-arc.c
bfd/libbfd.h
bfd/reloc.c
gas/config/tc-arc.c
gas/config/tc-arc.h
opcodes/arc-opc.c

index 35f8c1ee09605535864089178c991e74f4336367..caad47a4a62921abe724e083ff54a13c83e72693 100644 (file)
@@ -4402,11 +4402,6 @@ enum bfd_reloc_code_real
   BFD_RELOC_SH_FUNCDESC,
 
   /* ARC relocs.  */
-  BFD_RELOC_ARC_NONE,
-  BFD_RELOC_ARC_8,
-  BFD_RELOC_ARC_16,
-  BFD_RELOC_ARC_24,
-  BFD_RELOC_ARC_32,
   BFD_RELOC_ARC_N8,
   BFD_RELOC_ARC_N16,
   BFD_RELOC_ARC_N24,
@@ -4445,10 +4440,8 @@ enum bfd_reloc_code_real
   BFD_RELOC_ARC_SDA_12,
   BFD_RELOC_ARC_SDA16_ST2,
   BFD_RELOC_ARC_32_PCREL,
-  BFD_RELOC_ARC_PC32,
   BFD_RELOC_ARC_GOT32,
   BFD_RELOC_ARC_GOTPC32,
-  BFD_RELOC_ARC_PLT32,
   BFD_RELOC_ARC_COPY,
   BFD_RELOC_ARC_GLOB_DAT,
   BFD_RELOC_ARC_JMP_SLOT,
index c1a9fb699a4189920d381ab0d0888d46db439219..3ba299bd00e9ffaa5b2fad2a89e1af207def1368 100644 (file)
@@ -377,15 +377,18 @@ arc_elf_link_hash_table_create (bfd *abfd)
 #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \
   { BFD_RELOC_##TYPE, R_##TYPE },
 
+/* Aliases.  */
+#define BFD_RELOC_ARC_NONE     BFD_RELOC_NONE
+#define BFD_RELOC_ARC_8                BFD_RELOC_8
+#define BFD_RELOC_ARC_16       BFD_RELOC_16
+#define BFD_RELOC_ARC_24       BFD_RELOC_24
+#define BFD_RELOC_ARC_32       BFD_RELOC_32
+#define BFD_RELOC_ARC_PC32     BFD_RELOC_32_PCREL
+#define BFD_RELOC_ARC_PLT32    BFD_RELOC_32_PLT_PCREL
+
 static const struct arc_reloc_map arc_reloc_map[] =
 {
 #include "elf/arc-reloc.def"
-
-  {BFD_RELOC_NONE,  R_ARC_NONE},
-  {BFD_RELOC_8,  R_ARC_8},
-  {BFD_RELOC_16, R_ARC_16},
-  {BFD_RELOC_24, R_ARC_24},
-  {BFD_RELOC_32, R_ARC_32},
 };
 
 #undef ARC_RELOC_HOWTO
index 1196041c47b98efb299234ee587f4f05294ab97a..91cdee7fc4ae7720a1ab4fde17fda562d806e61d 100644 (file)
@@ -1888,11 +1888,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_SH_GOTOFFFUNCDESC",
   "BFD_RELOC_SH_GOTOFFFUNCDESC20",
   "BFD_RELOC_SH_FUNCDESC",
-  "BFD_RELOC_ARC_NONE",
-  "BFD_RELOC_ARC_8",
-  "BFD_RELOC_ARC_16",
-  "BFD_RELOC_ARC_24",
-  "BFD_RELOC_ARC_32",
   "BFD_RELOC_ARC_N8",
   "BFD_RELOC_ARC_N16",
   "BFD_RELOC_ARC_N24",
@@ -1931,10 +1926,8 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_ARC_SDA_12",
   "BFD_RELOC_ARC_SDA16_ST2",
   "BFD_RELOC_ARC_32_PCREL",
-  "BFD_RELOC_ARC_PC32",
   "BFD_RELOC_ARC_GOT32",
   "BFD_RELOC_ARC_GOTPC32",
-  "BFD_RELOC_ARC_PLT32",
   "BFD_RELOC_ARC_COPY",
   "BFD_RELOC_ARC_GLOB_DAT",
   "BFD_RELOC_ARC_JMP_SLOT",
index af21596aba4f55370b1862992b8e4c9b25b8ae23..18f53e38255af716031a6775b78813764e1967d5 100644 (file)
@@ -3417,16 +3417,6 @@ ENUMDOC
   Renesas / SuperH SH relocs.  Not all of these appear in object files.
 
 ENUM
-  BFD_RELOC_ARC_NONE
-ENUMX
-  BFD_RELOC_ARC_8
-ENUMX
-  BFD_RELOC_ARC_16
-ENUMX
-  BFD_RELOC_ARC_24
-ENUMX
-  BFD_RELOC_ARC_32
-ENUMX
   BFD_RELOC_ARC_N8
 ENUMX
   BFD_RELOC_ARC_N16
@@ -3502,14 +3492,10 @@ ENUMX
   BFD_RELOC_ARC_SDA16_ST2
 ENUMX
   BFD_RELOC_ARC_32_PCREL
-ENUMX
-  BFD_RELOC_ARC_PC32
 ENUMX
   BFD_RELOC_ARC_GOT32
 ENUMX
   BFD_RELOC_ARC_GOTPC32
-ENUMX
-  BFD_RELOC_ARC_PLT32
 ENUMX
   BFD_RELOC_ARC_COPY
 ENUMX
index d5dee067ab0ad4dbab3b22f70a3bdb22af222ee7..2a324bfaab36c8d2b03605d65b55e635398bf579 100644 (file)
@@ -544,9 +544,9 @@ static const struct arc_reloc_op_tag
 {
   DEF (gotoff,  BFD_RELOC_ARC_GOTOFF,          1),
   DEF (gotpc,   BFD_RELOC_ARC_GOTPC32,         0),
-  DEF (plt,    BFD_RELOC_ARC_PLT32,            0),
+  DEF (plt,    BFD_RELOC_32_PLT_PCREL,         0),
   DEF (sda,    DUMMY_RELOC_ARC_ENTRY,          1),
-  DEF (pcl,    BFD_RELOC_ARC_PC32,             1),
+  DEF (pcl,    BFD_RELOC_32_PCREL,             1),
   DEF (tlsgd,   BFD_RELOC_ARC_TLS_GD_GOT,      0),
   DEF (tlsie,   BFD_RELOC_ARC_TLS_IE_GOT,      0),
   DEF (tpoff9,  BFD_RELOC_ARC_TLS_LE_S9,       0),
@@ -1593,7 +1593,7 @@ get_register (symbolS *sym)
 }
 
 /* Return true if a RELOC is generic.  A generic reloc is PC-rel of a
-   simple ME relocation (e.g. RELOC_ARC_32_ME, BFD_RELOC_ARC_PC32.  */
+   simple ME relocation (e.g. RELOC_ARC_32_ME, BFD_RELOC_32_PCREL.  */
 
 static bool
 generic_reloc_p (extended_bfd_reloc_code_real_type reloc)
@@ -2785,7 +2785,7 @@ md_pcrel_from_section (fixS *fixP,
     {
       switch (fixP->fx_r_type)
        {
-       case BFD_RELOC_ARC_PC32:
+       case BFD_RELOC_32_PCREL:
          /* The hardware calculates relative to the start of the
             insn, but this relocation is relative to location of the
             LIMM, compensate.  The base always needs to be
@@ -2793,7 +2793,7 @@ md_pcrel_from_section (fixS *fixP,
             relocation for short instructions.  */
          base -= 4;
          /* Fall through.  */
-       case BFD_RELOC_ARC_PLT32:
+       case BFD_RELOC_32_PLT_PCREL:
        case BFD_RELOC_ARC_S25H_PCREL_PLT:
        case BFD_RELOC_ARC_S21H_PCREL_PLT:
        case BFD_RELOC_ARC_S25W_PCREL_PLT:
@@ -3001,9 +3001,9 @@ md_apply_fix (fixS *fixP,
          fixP->fx_offset += fixP->fx_frag->fr_address;
          /* Fall through.  */
        case BFD_RELOC_32:
-         fixP->fx_r_type = BFD_RELOC_ARC_PC32;
+         fixP->fx_r_type = BFD_RELOC_32_PCREL;
          /* Fall through.  */
-       case BFD_RELOC_ARC_PC32:
+       case BFD_RELOC_32_PCREL:
          /* fixP->fx_offset += fixP->fx_where - fixP->fx_dot_value; */
          break;
        default:
@@ -3101,11 +3101,11 @@ md_apply_fix (fixS *fixP,
 
     case BFD_RELOC_ARC_GOTOFF:
     case BFD_RELOC_ARC_32_ME:
-    case BFD_RELOC_ARC_PC32:
+    case BFD_RELOC_32_PCREL:
       md_number_to_chars_midend (fixpos, value, fixP->fx_size);
       return;
 
-    case BFD_RELOC_ARC_PLT32:
+    case BFD_RELOC_32_PLT_PCREL:
       md_number_to_chars_midend (fixpos, value, fixP->fx_size);
       return;
 
@@ -4216,7 +4216,7 @@ tc_arc_fix_adjustable (fixS *fixP)
   switch (fixP->fx_r_type)
     {
     case BFD_RELOC_ARC_GOTPC32:
-    case BFD_RELOC_ARC_PLT32:
+    case BFD_RELOC_32_PLT_PCREL:
     case BFD_RELOC_ARC_S25H_PCREL_PLT:
     case BFD_RELOC_ARC_S21H_PCREL_PLT:
     case BFD_RELOC_ARC_S25W_PCREL_PLT:
index 0ab2eb95cad87f59db0cdfdf435f0b26005e6c84..d3cd3cb67ac84965956635a7359bc11717474b15 100644 (file)
@@ -130,7 +130,7 @@ extern const char *arc_target_format;
    make sure that the fixup refers to some sort of label.  */
 #define TC_VALIDATE_FIX(FIXP,SEG,SKIP)                              \
   if ((FIXP->fx_r_type == BFD_RELOC_ARC_GOTPC32                             \
-       || FIXP->fx_r_type == BFD_RELOC_ARC_PLT32                    \
+       || FIXP->fx_r_type == BFD_RELOC_32_PLT_PCREL                 \
        || FIXP->fx_r_type == BFD_RELOC_ARC_S25W_PCREL_PLT           \
        || FIXP->fx_r_type == BFD_RELOC_ARC_S25H_PCREL_PLT           \
        || FIXP->fx_r_type == BFD_RELOC_ARC_S21W_PCREL_PLT           \
index 7aa26189c66d2ca45989d071f4da8d8ee1500920..e9ea1b46b754c00ca1914ba8808de1046c76f302 100644 (file)
@@ -2737,7 +2737,7 @@ const struct arc_reloc_equiv_tab arc_reloc_equiv[] =
   { "plt", 0, { F_NULL }, BFD_RELOC_ARC_S21W_PCREL,
     BFD_RELOC_ARC_S21W_PCREL_PLT },
 
-  { "plt", 0, { F_NULL }, BFD_RELOC_ARC_32_ME, BFD_RELOC_ARC_PLT32 }
+  { "plt", 0, { F_NULL }, BFD_RELOC_ARC_32_ME, BFD_RELOC_32_PLT_PCREL }
 };
 
 const unsigned arc_num_equiv_tab = ARRAY_SIZE (arc_reloc_equiv);