[PATCH] ld: Fix several 32-bit SPARC plugin tests
Nick Clifton
nickc@redhat.com
Mon Apr 6 14:57:50 GMT 2020
Hi Rainer,
My guess as to the reason for the abort() was that the writer wanted to
catch unhandled sparc machine values. So please could you try changing
the patch to this:
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index 65c81ecccf..aba81fae1a 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -150,6 +150,8 @@ sparc_final_write_processing (bfd *abfd)
case bfd_mach_sparc_sparclite_le :
elf_elfheader (abfd)->e_flags |= EF_SPARC_LEDATA;
break;
+ case 0: /* A non-sparc architecture - ignore. */
+ break;
default :
abort ();
break;
Or, if like me you do not like calls to abort() inside a library,
then how about this:
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index 65c81ecccf..e6c873ddf1 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -150,8 +150,11 @@ sparc_final_write_processing (bfd *abfd)
case bfd_mach_sparc_sparclite_le :
elf_elfheader (abfd)->e_flags |= EF_SPARC_LEDATA;
break;
+ case 0: /* A non-sparc architecture - ignore. */
+ break;
default :
- abort ();
+ _bfd_error_handler (_("%pB: unhandled spac machine value '%lu' detected during write processing"),
+ abfd, (long) bfd_get_mach (abfd));
break;
}
}
Either of these is pre-approved for committal if they work for you.
Cheers
Nick
More information about the Binutils
mailing list