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

Doing the adjustments makes obvious that elf32_arm_reloc_map[] had two
identical entries; that duplicate is being removed.

bfd/bfd-in2.h
bfd/elf32-arm.c
bfd/libbfd.h
bfd/reloc.c
gas/config/tc-arm.c

index ff0c5f88cdc90ef1f622d888a658f5abe35a9091..35f8c1ee09605535864089178c991e74f4336367 100644 (file)
@@ -4209,7 +4209,6 @@ enum bfd_reloc_code_real
   BFD_RELOC_ARM_JUMP_SLOT,
   BFD_RELOC_ARM_GLOB_DAT,
   BFD_RELOC_ARM_GOT32,
-  BFD_RELOC_ARM_PLT32,
   BFD_RELOC_ARM_RELATIVE,
   BFD_RELOC_ARM_GOTOFF,
   BFD_RELOC_ARM_GOTPC,
index 24dde624d55836a792f7da572e7710146e43b1e2..ba477dc6e47ecc961d4c545a8b2eb175348af25c 100644 (file)
@@ -2023,13 +2023,12 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
     {BFD_RELOC_ARM_GOTPC,           R_ARM_GOTPC},
     {BFD_RELOC_ARM_GOT_PREL,        R_ARM_GOT_PREL},
     {BFD_RELOC_ARM_GOT32,           R_ARM_GOT32},
-    {BFD_RELOC_ARM_PLT32,           R_ARM_PLT32},
+    {BFD_RELOC_32_PLT_PCREL,        R_ARM_PLT32},
     {BFD_RELOC_ARM_TARGET1,         R_ARM_TARGET1},
     {BFD_RELOC_ARM_ROSEGREL32,      R_ARM_ROSEGREL32},
     {BFD_RELOC_ARM_SBREL32,         R_ARM_SBREL32},
     {BFD_RELOC_ARM_PREL31,          R_ARM_PREL31},
     {BFD_RELOC_ARM_TARGET2,         R_ARM_TARGET2},
-    {BFD_RELOC_ARM_PLT32,           R_ARM_PLT32},
     {BFD_RELOC_ARM_TLS_GOTDESC,             R_ARM_TLS_GOTDESC},
     {BFD_RELOC_ARM_TLS_CALL,        R_ARM_TLS_CALL},
     {BFD_RELOC_ARM_THM_TLS_CALL,     R_ARM_THM_TLS_CALL},
index c8249710dff9f315085732dec84543eb81e7144f..1196041c47b98efb299234ee587f4f05294ab97a 100644 (file)
@@ -1712,7 +1712,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_ARM_JUMP_SLOT",
   "BFD_RELOC_ARM_GLOB_DAT",
   "BFD_RELOC_ARM_GOT32",
-  "BFD_RELOC_ARM_PLT32",
   "BFD_RELOC_ARM_RELATIVE",
   "BFD_RELOC_ARM_GOTOFF",
   "BFD_RELOC_ARM_GOTPC",
index 699c042cece3d730e6a1ac6fbe87c631f8192c7a..af21596aba4f55370b1862992b8e4c9b25b8ae23 100644 (file)
@@ -3039,8 +3039,6 @@ ENUMX
   BFD_RELOC_ARM_GLOB_DAT
 ENUMX
   BFD_RELOC_ARM_GOT32
-ENUMX
-  BFD_RELOC_ARM_PLT32
 ENUMX
   BFD_RELOC_ARM_RELATIVE
 ENUMX
index 2eed286448e0c16ce208895f140ed0b756972581..abad78a742f2bc70b16d97df7e4dfd3ca0c67d30 100644 (file)
@@ -3849,7 +3849,7 @@ s_arm_elf_cons (int nbytes)
                                                               reloc);
              int size = bfd_get_reloc_size (howto);
 
-             if (reloc == BFD_RELOC_ARM_PLT32)
+             if (reloc == BFD_RELOC_32_PLT_PCREL)
                {
                  as_bad (_("(plt) is only valid on branch targets"));
                  reloc = BFD_RELOC_UNUSED;
@@ -9304,11 +9304,11 @@ encode_branch (int default_reloc)
 {
   if (inst.operands[0].hasreloc)
     {
-      constraint (inst.operands[0].imm != BFD_RELOC_ARM_PLT32
+      constraint (inst.operands[0].imm != BFD_RELOC_32_PLT_PCREL
                  && inst.operands[0].imm != BFD_RELOC_ARM_TLS_CALL,
                  _("the only valid suffixes here are '(plt)' and '(tlscall)'"));
-      inst.relocs[0].type = inst.operands[0].imm == BFD_RELOC_ARM_PLT32
-       ? BFD_RELOC_ARM_PLT32
+      inst.relocs[0].type = inst.operands[0].imm == BFD_RELOC_32_PLT_PCREL
+       ? BFD_RELOC_32_PLT_PCREL
        : thumb_mode ? BFD_RELOC_ARM_THM_TLS_CALL : BFD_RELOC_ARM_TLS_CALL;
     }
   else
@@ -12019,7 +12019,7 @@ do_t_branch23 (void)
      the branch encoding is now needed to deal with TLSCALL relocs.
      So if we see a PLT reloc now, put it back to how it used to be to
      keep the preexisting behaviour.  */
-  if (inst.relocs[0].type == BFD_RELOC_ARM_PLT32)
+  if (inst.relocs[0].type == BFD_RELOC_32_PLT_PCREL)
     inst.relocs[0].type = BFD_RELOC_THUMB_PCREL_BRANCH23;
 
 #if defined(OBJ_COFF)
@@ -23899,7 +23899,7 @@ static struct reloc_entry reloc_names[] =
 {
   { "got",     BFD_RELOC_ARM_GOT32   },         { "GOT",     BFD_RELOC_ARM_GOT32   },
   { "gotoff",  BFD_RELOC_ARM_GOTOFF  },         { "GOTOFF",  BFD_RELOC_ARM_GOTOFF  },
-  { "plt",     BFD_RELOC_ARM_PLT32   },         { "PLT",     BFD_RELOC_ARM_PLT32   },
+  { "plt",     BFD_RELOC_32_PLT_PCREL},         { "PLT",     BFD_RELOC_32_PLT_PCREL},
   { "target1", BFD_RELOC_ARM_TARGET1 },         { "TARGET1", BFD_RELOC_ARM_TARGET1 },
   { "target2", BFD_RELOC_ARM_TARGET2 },         { "TARGET2", BFD_RELOC_ARM_TARGET2 },
   { "sbrel",   BFD_RELOC_ARM_SBREL32 },         { "SBREL",   BFD_RELOC_ARM_SBREL32 },
@@ -27245,7 +27245,7 @@ md_pcrel_from_section (fixS * fixP, segT seg)
 
     case BFD_RELOC_ARM_PCREL_BRANCH:
     case BFD_RELOC_ARM_PCREL_JUMP:
-    case BFD_RELOC_ARM_PLT32:
+    case BFD_RELOC_32_PLT_PCREL:
 #ifdef TE_WINCE
       /* When handling fixups immediately, because we have already
         discovered the value of a symbol, or the address of the frag involved
@@ -28197,7 +28197,7 @@ md_apply_fix (fixS *    fixP,
        }
       /* Fall through.  */
 
-    case BFD_RELOC_ARM_PLT32:
+    case BFD_RELOC_32_PLT_PCREL:
 #endif
     case BFD_RELOC_ARM_PCREL_BRANCH:
       temp = 3;
@@ -29419,7 +29419,7 @@ tc_gen_reloc (asection *section, fixS *fixp)
     case BFD_RELOC_ARM_GOT32:
     case BFD_RELOC_ARM_GOTOFF:
     case BFD_RELOC_ARM_GOT_PREL:
-    case BFD_RELOC_ARM_PLT32:
+    case BFD_RELOC_32_PLT_PCREL:
     case BFD_RELOC_ARM_TARGET1:
     case BFD_RELOC_ARM_ROSEGREL32:
     case BFD_RELOC_ARM_SBREL32:
@@ -29748,7 +29748,7 @@ arm_fix_adjustable (fixS * fixP)
     return false;
 
   /* Don't allow symbols to be discarded on GOT related relocs.         */
-  if (fixP->fx_r_type == BFD_RELOC_ARM_PLT32
+  if (fixP->fx_r_type == BFD_RELOC_32_PLT_PCREL
       || fixP->fx_r_type == BFD_RELOC_ARM_GOT32
       || fixP->fx_r_type == BFD_RELOC_ARM_GOTOFF
       || fixP->fx_r_type == BFD_RELOC_ARM_TLS_GD32
@@ -30062,7 +30062,7 @@ md_begin (void)
     {
       struct reloc_entry * entry = reloc_names + i;
 
-      if (arm_is_eabi() && entry->reloc == BFD_RELOC_ARM_PLT32)
+      if (arm_is_eabi() && entry->reloc == BFD_RELOC_32_PLT_PCREL)
        /* This makes encode_branch() use the EABI versions of this relocation.  */
        entry->reloc = BFD_RELOC_UNUSED;