]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86-64: use BFD_RELOC_64_PLTOFF in favor of custom type
authorJan Beulich <jbeulich@suse.com>
Fri, 5 Dec 2025 09:18:34 +0000 (10:18 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 5 Dec 2025 09:18:34 +0000 (10:18 +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 1d2e2c380a445225f2c4346a593bf7a2876c59d4..03649e6a461c45ba9e67571c97b03b244397f59e 100644 (file)
@@ -3892,7 +3892,6 @@ enum bfd_reloc_code_real
   BFD_RELOC_X86_64_GOTPCREL64,
   BFD_RELOC_X86_64_GOTPC64,
   BFD_RELOC_X86_64_GOTPLT64,
-  BFD_RELOC_X86_64_PLTOFF64,
   BFD_RELOC_X86_64_GOTPC32_TLSDESC,
   BFD_RELOC_X86_64_TLSDESC_CALL,
   BFD_RELOC_X86_64_TLSDESC,
index 1bffced9a30ea0e5a458da75969225af5f62193c..7b399ae6149f35943e38357cb6bcd01d995d0650 100644 (file)
@@ -260,7 +260,7 @@ static const struct elf_reloc_map x86_64_reloc_map[] =
   { BFD_RELOC_X86_64_GOTPCREL64,R_X86_64_GOTPCREL64, },
   { BFD_RELOC_X86_64_GOTPC64,  R_X86_64_GOTPC64, },
   { BFD_RELOC_X86_64_GOTPLT64, R_X86_64_GOTPLT64, },
-  { BFD_RELOC_X86_64_PLTOFF64, R_X86_64_PLTOFF64, },
+  { BFD_RELOC_64_PLTOFF,       R_X86_64_PLTOFF64, },
   { BFD_RELOC_SIZE32,          R_X86_64_SIZE32, },
   { BFD_RELOC_SIZE64,          R_X86_64_SIZE64, },
   { BFD_RELOC_X86_64_GOTPC32_TLSDESC, R_X86_64_GOTPC32_TLSDESC, },
index f349e342766a4c9bfb6383506fdc408dfee93636..a2883f964cf1a0161b4714bad85e2f7d535f426e 100644 (file)
@@ -1466,7 +1466,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_X86_64_GOTPCREL64",
   "BFD_RELOC_X86_64_GOTPC64",
   "BFD_RELOC_X86_64_GOTPLT64",
-  "BFD_RELOC_X86_64_PLTOFF64",
   "BFD_RELOC_X86_64_GOTPC32_TLSDESC",
   "BFD_RELOC_X86_64_TLSDESC_CALL",
   "BFD_RELOC_X86_64_TLSDESC",
index a44b99596a817737f6e77e8a26194deddf26505c..6c65bbdd22bfb906aa6b6da15b7e06f29a21f4b6 100644 (file)
@@ -2457,8 +2457,6 @@ ENUMX
   BFD_RELOC_X86_64_GOTPC64
 ENUMX
   BFD_RELOC_X86_64_GOTPLT64
-ENUMX
-  BFD_RELOC_X86_64_PLTOFF64
 ENUMX
   BFD_RELOC_X86_64_GOTPC32_TLSDESC
 ENUMX
index cb57ecd037e66d4572400ee14c422b1d7a1f0863..03eaf63701fb8f4216e00131acc728fe67c85309 100644 (file)
@@ -1395,7 +1395,7 @@ gotrel[] =
     { .bitfield = { .imm32 = 1, .imm64 = 1 } }, false },
 #endif
     { STRING_COMMA_LEN ("PLTOFF"),   { _dummy_first_bfd_reloc_code_real,
-                                      BFD_RELOC_X86_64_PLTOFF64 },
+                                      BFD_RELOC_64_PLTOFF },
     { .bitfield = { .imm64 = 1 } }, true },
     { STRING_COMMA_LEN ("PLT"),      { BFD_RELOC_386_PLT32,
                                       BFD_RELOC_X86_64_PLT32    },
@@ -3965,15 +3965,11 @@ _reloc (unsigned int size,
       if (size == 8)
        switch (other)
          {
+         case BFD_RELOC_64_PLTOFF:
+         case BFD_RELOC_X86_64_GOTPLT64:
+           return other;
          case BFD_RELOC_X86_64_GOT32:
            return BFD_RELOC_X86_64_GOT64;
-           break;
-         case BFD_RELOC_X86_64_GOTPLT64:
-           return BFD_RELOC_X86_64_GOTPLT64;
-           break;
-         case BFD_RELOC_X86_64_PLTOFF64:
-           return BFD_RELOC_X86_64_PLTOFF64;
-           break;
          case BFD_RELOC_X86_64_GOTPC32:
            other = BFD_RELOC_X86_64_GOTPC64;
            break;
@@ -18471,7 +18467,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
     case BFD_RELOC_X86_64_GOTPCREL64:
     case BFD_RELOC_X86_64_GOTPC64:
     case BFD_RELOC_X86_64_GOTPLT64:
-    case BFD_RELOC_X86_64_PLTOFF64:
+    case BFD_RELOC_64_PLTOFF:
     case BFD_RELOC_X86_64_GOTPC32_TLSDESC:
     case BFD_RELOC_X86_64_CODE_4_GOTPC32_TLSDESC:
     case BFD_RELOC_X86_64_CODE_5_GOTPC32_TLSDESC:
@@ -18585,7 +18581,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
          case BFD_RELOC_X86_64_GOTPCREL64:
          case BFD_RELOC_X86_64_GOTPC64:
          case BFD_RELOC_X86_64_GOTPLT64:
-         case BFD_RELOC_X86_64_PLTOFF64:
+         case BFD_RELOC_64_PLTOFF:
            as_bad_where (fixp->fx_file, fixp->fx_line,
                          _("cannot represent relocation type %s in x32 mode"),
                          bfd_get_reloc_code_name (code));