[08/14] S/390: use BFD_RELOC_<n>_PLT_PCREL in favor of custom types

Message ID b694afe8-33a2-4379-9757-e1fc9a934f92@suse.com
State New
Headers
Series bfd: a little bit of reloc enum cleanup |

Commit Message

Jan Beulich Nov. 28, 2025, 11:33 a.m. UTC
  No reason to have separate types when the generic ones have no (other)
meaning for this target.
  

Patch

--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -5510,9 +5510,6 @@  enum bfd_reloc_code_real
   /* 12 bit GOT offset.  */
   BFD_RELOC_390_GOT12,
 
-  /* 32 bit PC relative PLT address.  */
-  BFD_RELOC_390_PLT32,
-
   /* Copy symbol at runtime.  */
   BFD_RELOC_390_COPY,
 
@@ -5561,9 +5558,6 @@  enum bfd_reloc_code_real
   /* 64 bit GOT offset.  */
   BFD_RELOC_390_GOT64,
 
-  /* 64 bit PC relative PLT address.  */
-  BFD_RELOC_390_PLT64,
-
   /* 32 bit rel. offset to GOT entry.  */
   BFD_RELOC_390_GOTENT,
 
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -201,7 +201,7 @@  elf_s390_reloc_type_lookup (bfd *abfd AT
       return &elf_howto_table[(int) R_390_GOT12];
     case BFD_RELOC_32_GOT_PCREL:
       return &elf_howto_table[(int) R_390_GOT32];
-    case BFD_RELOC_390_PLT32:
+    case BFD_RELOC_32_PLT_PCREL:
       return &elf_howto_table[(int) R_390_PLT32];
     case BFD_RELOC_390_COPY:
       return &elf_howto_table[(int) R_390_COPY];
--- a/bfd/elf64-s390.c
+++ b/bfd/elf64-s390.c
@@ -215,7 +215,7 @@  elf_s390_reloc_type_lookup (bfd *abfd,
       return &elf_howto_table[(int) R_390_GOT12];
     case BFD_RELOC_32_GOT_PCREL:
       return &elf_howto_table[(int) R_390_GOT32];
-    case BFD_RELOC_390_PLT32:
+    case BFD_RELOC_32_PLT_PCREL:
       return &elf_howto_table[(int) R_390_PLT32];
     case BFD_RELOC_390_COPY:
       return &elf_howto_table[(int) R_390_COPY];
@@ -257,7 +257,7 @@  elf_s390_reloc_type_lookup (bfd *abfd,
       return &elf_howto_table[(int) R_390_PC64];
     case BFD_RELOC_390_GOT64:
       return &elf_howto_table[(int) R_390_GOT64];
-    case BFD_RELOC_390_PLT64:
+    case BFD_RELOC_64_PLT_PCREL:
       return &elf_howto_table[(int) R_390_PLT64];
     case BFD_RELOC_390_GOTENT:
       return &elf_howto_table[(int) R_390_GOTENT];
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -2491,7 +2491,6 @@  static const char *const bfd_reloc_code_
   "BFD_RELOC_RX_RELAX",
   "BFD_RELOC_390_12",
   "BFD_RELOC_390_GOT12",
-  "BFD_RELOC_390_PLT32",
   "BFD_RELOC_390_COPY",
   "BFD_RELOC_390_GLOB_DAT",
   "BFD_RELOC_390_JMP_SLOT",
@@ -2508,7 +2507,6 @@  static const char *const bfd_reloc_code_
   "BFD_RELOC_390_PLT32DBL",
   "BFD_RELOC_390_GOTPCDBL",
   "BFD_RELOC_390_GOT64",
-  "BFD_RELOC_390_PLT64",
   "BFD_RELOC_390_GOTENT",
   "BFD_RELOC_390_GOTOFF64",
   "BFD_RELOC_390_GOTPLT12",
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -5147,10 +5147,6 @@  ENUM
 ENUMDOC
   12 bit GOT offset.
 ENUM
-  BFD_RELOC_390_PLT32
-ENUMDOC
-  32 bit PC relative PLT address.
-ENUM
   BFD_RELOC_390_COPY
 ENUMDOC
   Copy symbol at runtime.
@@ -5215,10 +5211,6 @@  ENUM
 ENUMDOC
   64 bit GOT offset.
 ENUM
-  BFD_RELOC_390_PLT64
-ENUMDOC
-  64 bit PC relative PLT address.
-ENUM
   BFD_RELOC_390_GOTENT
 ENUMDOC
   32 bit rel. offset to GOT entry.
--- a/gas/config/tc-s390.c
+++ b/gas/config/tc-s390.c
@@ -1114,9 +1114,9 @@  s390_lit_suffix (char **str_p, expressio
   else if (suffix == ELF_SUFFIX_PLT)
     {
       if (nbytes == 4)
-	reloc = BFD_RELOC_390_PLT32;
+	reloc = BFD_RELOC_32_PLT_PCREL;
       else if (nbytes == 8)
-	reloc = BFD_RELOC_390_PLT64;
+	reloc = BFD_RELOC_64_PLT_PCREL;
     }
 
   if (suffix != ELF_SUFFIX_NONE && reloc == BFD_RELOC_UNUSED)
@@ -1272,7 +1272,7 @@  s390_elf_cons (int nbytes /* 1=.byte, 2=
 		{
 		  BFD_RELOC_UNUSED, 		/* ELF_SUFFIX_NONE  */
 		  BFD_RELOC_32_GOT_PCREL,	/* ELF_SUFFIX_GOT  */
-		  BFD_RELOC_390_PLT32,		/* ELF_SUFFIX_PLT  */
+		  BFD_RELOC_32_PLT_PCREL,	/* ELF_SUFFIX_PLT  */
 		  BFD_RELOC_UNUSED,		/* ELF_SUFFIX_GOTENT  */
 		  BFD_RELOC_32_GOTOFF,		/* ELF_SUFFIX_GOTOFF  */
 		  BFD_RELOC_390_GOTPLT32,	/* ELF_SUFFIX_GOTPLT  */
@@ -1292,7 +1292,7 @@  s390_elf_cons (int nbytes /* 1=.byte, 2=
 		{
 		  BFD_RELOC_UNUSED, 		/* ELF_SUFFIX_NONE  */
 		  BFD_RELOC_390_GOT64,		/* ELF_SUFFIX_GOT  */
-		  BFD_RELOC_390_PLT64,		/* ELF_SUFFIX_PLT  */
+		  BFD_RELOC_64_PLT_PCREL,	/* ELF_SUFFIX_PLT  */
 		  BFD_RELOC_UNUSED,		/* ELF_SUFFIX_GOTENT  */
 		  BFD_RELOC_390_GOTOFF64,	/* ELF_SUFFIX_GOTOFF  */
 		  BFD_RELOC_390_GOTPLT64,	/* ELF_SUFFIX_GOTPLT  */
@@ -2390,9 +2390,9 @@  tc_s390_fix_adjustable (fixS *fixP)
       || fixP->fx_r_type == BFD_RELOC_390_PLT12DBL
       || fixP->fx_r_type == BFD_RELOC_390_PLT16DBL
       || fixP->fx_r_type == BFD_RELOC_390_PLT24DBL
-      || fixP->fx_r_type == BFD_RELOC_390_PLT32
+      || fixP->fx_r_type == BFD_RELOC_32_PLT_PCREL
       || fixP->fx_r_type == BFD_RELOC_390_PLT32DBL
-      || fixP->fx_r_type == BFD_RELOC_390_PLT64
+      || fixP->fx_r_type == BFD_RELOC_64_PLT_PCREL
       || fixP->fx_r_type == BFD_RELOC_390_GOT12
       || fixP->fx_r_type == BFD_RELOC_390_GOT20
       || fixP->fx_r_type == BFD_RELOC_390_GOT16
@@ -2454,12 +2454,12 @@  tc_s390_force_relocation (struct fix *fi
     case BFD_RELOC_390_GOTPCDBL:
     case BFD_RELOC_390_GOT64:
     case BFD_RELOC_390_GOTENT:
-    case BFD_RELOC_390_PLT32:
+    case BFD_RELOC_32_PLT_PCREL:
     case BFD_RELOC_390_PLT12DBL:
     case BFD_RELOC_390_PLT16DBL:
     case BFD_RELOC_390_PLT24DBL:
     case BFD_RELOC_390_PLT32DBL:
-    case BFD_RELOC_390_PLT64:
+    case BFD_RELOC_64_PLT_PCREL:
     case BFD_RELOC_390_GOTPLT12:
     case BFD_RELOC_390_GOTPLT16:
     case BFD_RELOC_390_GOTPLT20:
@@ -2730,7 +2730,7 @@  md_apply_fix (fixS *fixP, valueT *valP,
 	  break;
 	case BFD_RELOC_32_GOT_PCREL:
 	case BFD_RELOC_390_PLTOFF32:
-	case BFD_RELOC_390_PLT32:
+	case BFD_RELOC_32_PLT_PCREL:
 	case BFD_RELOC_390_GOTPLT32:
 	  if (fixP->fx_done)
 	    md_number_to_chars (where, value, 4);
@@ -2757,7 +2757,7 @@  md_apply_fix (fixS *fixP, valueT *valP,
 
 	case BFD_RELOC_390_GOT64:
 	case BFD_RELOC_390_PLTOFF64:
-	case BFD_RELOC_390_PLT64:
+	case BFD_RELOC_64_PLT_PCREL:
 	case BFD_RELOC_390_GOTPLT64:
 	  if (fixP->fx_done)
 	    md_number_to_chars (where, value, 8);