[PATCH 07/10] s390: Sync relocation error message between {elf32|elf64}-s390.c

Jens Remus jremus@linux.ibm.com
Thu Nov 13 13:21:58 GMT 2025


Over time elf32-s390.c and elf64-s390.c have diverged in some areas.

Apply relocation error message, introduced by commit f3185997ac09 in
elf64-s390.c function elf_s390_reloc_type_lookup, to its elf32-s390.c
counterpart as well.

Additionally this simplifies comparison of elf32-s390.c and
elf64-s390.c, as it reduces the number of differences.

bfd/
	* elf32-s390.c (elf_s390_reloc_type_lookup): Add error message
	from elf64-s390.c.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
---
 bfd/elf32-s390.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index f02fdc144306..87bc544f8306 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -178,7 +178,7 @@ static reloc_howto_type elf32_s390_vtentry_howto =
   HOWTO (R_390_GNU_VTENTRY, 0,4,0,false,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", false,0,0, false);
 
 static reloc_howto_type *
-elf_s390_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+elf_s390_reloc_type_lookup (bfd *abfd,
 			    bfd_reloc_code_real_type code)
 {
   switch (code)
@@ -298,6 +298,10 @@ elf_s390_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
     default:
       break;
     }
+
+  /* xgettext:c-format */
+  _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, (int) code);
+  bfd_set_error (bfd_error_bad_value);
   return NULL;
 }
 
-- 
2.48.1



More information about the Binutils mailing list