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

bfd/bfd-in2.h
bfd/elf64-x86-64.c
bfd/libbfd.h
bfd/reloc.c
gas/config/tc-i386.c

index 03649e6a461c45ba9e67571c97b03b244397f59e..c89fe7ad8ac5eb0bd8a25559ff16c45991b1873d 100644 (file)
@@ -3871,7 +3871,6 @@ enum bfd_reloc_code_real
 
   /* x86-64/elf relocations.  */
   BFD_RELOC_X86_64_GOT32,
-  BFD_RELOC_X86_64_PLT32,
   BFD_RELOC_X86_64_COPY,
   BFD_RELOC_X86_64_GLOB_DAT,
   BFD_RELOC_X86_64_JUMP_SLOT,
index 7b399ae6149f35943e38357cb6bcd01d995d0650..3eb2fe0aefaa0bf22191cc6d56b7e38d4bcdab2c 100644 (file)
@@ -233,7 +233,7 @@ static const struct elf_reloc_map x86_64_reloc_map[] =
   { BFD_RELOC_64,              R_X86_64_64,   },
   { BFD_RELOC_32_PCREL,                R_X86_64_PC32, },
   { BFD_RELOC_X86_64_GOT32,    R_X86_64_GOT32,},
-  { BFD_RELOC_X86_64_PLT32,    R_X86_64_PLT32,},
+  { BFD_RELOC_32_PLT_PCREL,    R_X86_64_PLT32,},
   { BFD_RELOC_X86_64_COPY,     R_X86_64_COPY, },
   { BFD_RELOC_X86_64_GLOB_DAT, R_X86_64_GLOB_DAT, },
   { BFD_RELOC_X86_64_JUMP_SLOT, R_X86_64_JUMP_SLOT, },
index a2883f964cf1a0161b4714bad85e2f7d535f426e..6a2eff436a77f85f209c96bcb24508b9e71ea5d8 100644 (file)
@@ -1445,7 +1445,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_386_IRELATIVE",
   "BFD_RELOC_386_GOT32X",
   "BFD_RELOC_X86_64_GOT32",
-  "BFD_RELOC_X86_64_PLT32",
   "BFD_RELOC_X86_64_COPY",
   "BFD_RELOC_X86_64_GLOB_DAT",
   "BFD_RELOC_X86_64_JUMP_SLOT",
index 6c65bbdd22bfb906aa6b6da15b7e06f29a21f4b6..45ba8612e973de148413c6c8b1f807b2982fde05 100644 (file)
@@ -2415,8 +2415,6 @@ ENUMDOC
 
 ENUM
   BFD_RELOC_X86_64_GOT32
-ENUMX
-  BFD_RELOC_X86_64_PLT32
 ENUMX
   BFD_RELOC_X86_64_COPY
 ENUMX
index 03eaf63701fb8f4216e00131acc728fe67c85309..54c66789522850058b09fd8f2ca4c173c37bb2a1 100644 (file)
@@ -1398,7 +1398,7 @@ gotrel[] =
                                       BFD_RELOC_64_PLTOFF },
     { .bitfield = { .imm64 = 1 } }, true },
     { STRING_COMMA_LEN ("PLT"),      { BFD_RELOC_386_PLT32,
-                                      BFD_RELOC_X86_64_PLT32    },
+                                      BFD_RELOC_32_PLT_PCREL },
     OPERAND_TYPE_IMM32_32S_DISP32, false },
     { STRING_COMMA_LEN ("GOTPLT"),   { _dummy_first_bfd_reloc_code_real,
                                       BFD_RELOC_X86_64_GOTPLT64 },
@@ -4140,7 +4140,7 @@ tc_i386_fix_adjustable (fixS *fixP)
   /* Resolve PLT32 relocation against local symbol to section only for
      PC-relative relocations.  */
   if (fixP->fx_r_type == BFD_RELOC_386_PLT32
-      || fixP->fx_r_type == BFD_RELOC_X86_64_PLT32)
+      || fixP->fx_r_type == BFD_RELOC_32_PLT_PCREL)
     return fixP->fx_pcrel;
   return 1;
 }
@@ -11780,7 +11780,7 @@ output_jump (void)
   if (flag_code == CODE_64BIT && size == 4
       && jump_reloc == NO_RELOC && i.op[0].disps->X_add_number == 0
       && need_plt32_p (i.op[0].disps->X_add_symbol))
-    jump_reloc = BFD_RELOC_X86_64_PLT32;
+    jump_reloc = BFD_RELOC_32_PLT_PCREL;
 #endif
 
   jump_reloc = reloc (size, 1, 1, jump_reloc);
@@ -13426,7 +13426,7 @@ x86_cons (expressionS *exp, int size)
              *input_line_pointer = c;
            }
          else if ((got_reloc == BFD_RELOC_386_PLT32
-                   || got_reloc == BFD_RELOC_X86_64_PLT32)
+                   || got_reloc == BFD_RELOC_32_PLT_PCREL)
                   && exp->X_op != O_symbol)
            {
              char c = *input_line_pointer;
@@ -15770,7 +15770,7 @@ elf_symbol_resolved_in_segment_p (symbolS *fr_symbol, offsetT fr_var)
     switch ((enum bfd_reloc_code_real) fr_var)
       {
       case BFD_RELOC_386_PLT32:
-      case BFD_RELOC_X86_64_PLT32:
+      case BFD_RELOC_32_PLT_PCREL:
        /* Symbol with PLT relocation may be preempted. */
        return 0;
       default:
@@ -16231,7 +16231,7 @@ md_estimate_size_before_relax (fragS *fragP, segT segment)
          && fragP->tc_frag_data.code == CODE_64BIT
          && fragP->fr_offset == 0
          && need_plt32_p (fragP->fr_symbol))
-       reloc_type = BFD_RELOC_X86_64_PLT32;
+       reloc_type = BFD_RELOC_32_PLT_PCREL;
 #endif
 
       old_fr_fix = fragP->fr_fix;
@@ -16635,7 +16635,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
     switch (fixP->fx_r_type)
       {
       case BFD_RELOC_386_PLT32:
-      case BFD_RELOC_X86_64_PLT32:
+      case BFD_RELOC_32_PLT_PCREL:
        /* Make the jump instruction point to the address of the operand.
           At runtime we merely add the offset to the actual PLT entry.
           NB: Subtract the offset size only for jump instructions.  */
@@ -18352,7 +18352,7 @@ i386_validate_fix (fixS *fixp)
       if (fixp->fx_addsy
          && fixp->fx_pcrel
          && (fixp->fx_r_type == BFD_RELOC_386_PLT32
-             || fixp->fx_r_type == BFD_RELOC_X86_64_PLT32)
+             || fixp->fx_r_type == BFD_RELOC_32_PLT_PCREL)
          && symbol_section_p (fixp->fx_addsy))
        fixp->fx_r_type = BFD_RELOC_32_PCREL;
       if (!object_64bit)
@@ -18428,7 +18428,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
 #endif
       /* Fall through.  */
 
-    case BFD_RELOC_X86_64_PLT32:
+    case BFD_RELOC_32_PLT_PCREL:
     case BFD_RELOC_X86_64_GOT32:
     case BFD_RELOC_X86_64_GOTPCREL:
     case BFD_RELOC_X86_64_GOTPCRELX:
@@ -18595,7 +18595,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
       else
        switch (code)
          {
-         case BFD_RELOC_X86_64_PLT32:
+         case BFD_RELOC_32_PLT_PCREL:
          case BFD_RELOC_X86_64_GOT32:
          case BFD_RELOC_X86_64_GOTPCREL:
          case BFD_RELOC_X86_64_GOTPCRELX: