aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-sparc.c
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2020-04-07 16:52:03 +0200
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2020-04-07 16:52:03 +0200
commit3e97ba7d583055bdd5439dd300c59a2f5bc02476 (patch)
tree2f433a8895521ff52923982a0e3ffceba866f5bb /bfd/elf32-sparc.c
parent6e0e8b45026e04c25f1875ead25eb6e0e1ac31ae (diff)
downloadgdb-3e97ba7d583055bdd5439dd300c59a2f5bc02476.zip
gdb-3e97ba7d583055bdd5439dd300c59a2f5bc02476.tar.gz
gdb-3e97ba7d583055bdd5439dd300c59a2f5bc02476.tar.bz2
ld: Fix several 32-bit SPARC plugin tests
Several ld plugin tests currently FAIL on 32-bit Solaris/SPARC: FAIL: load plugin with source FAIL: plugin claimfile lost symbol with source FAIL: plugin claimfile replace symbol with source FAIL: plugin claimfile resolve symbol with source FAIL: plugin claimfile replace file with source FAIL: plugin set symbol visibility with source FAIL: plugin ignore lib with source FAIL: plugin claimfile replace lib with source FAIL: plugin 2 with source lib FAIL: load plugin 2 with source FAIL: load plugin 2 with source and -r FAIL: plugin 3 with source lib FAIL: load plugin 3 with source FAIL: load plugin 3 with source and -r FAIL: PR ld/20070 all of them in the same way: ./ld-new: BFD (GNU Binutils) 2.34.50.20200328 internal error, aborting at /vol/src/gnu/binutils/hg/master/git/bfd/elf32-sparc.c:154 in sparc_final_write_processing This happens when bfd_get_mach returns 0 when abfd refers to a source file: $11 = { filename = 0x28c358 "/vol/src/gnu/binutils/hg/master/local/ld/testsuite/ld-plugin/func.c (symbol from plugin)", xvec = 0x24ed6c <sparc_elf32_sol2_vec>, [...] While I could find no specification what abfd's are allowed/expected in *_final_write_processing, I could find no other target that behaved the same. And indeed ignoring the 0 case fixes the failures. The code now errors for other values. 64-bit SPARC is not affected because it doesn't have a specific implementation of elf_backend_final_write_processing. Tested on sparc-sun-solaris2.11. 2020-04-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> Nick Clifton <nickc@redhat.com> * elf32-sparc.c (sparc_final_write_processing): Fix whitespace. <0>: Ignore. <default>: Error rather than abort.
Diffstat (limited to 'bfd/elf32-sparc.c')
-rw-r--r--bfd/elf32-sparc.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index 65c81ec..27fc158 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -121,37 +121,41 @@ sparc_final_write_processing (bfd *abfd)
{
switch (bfd_get_mach (abfd))
{
- case bfd_mach_sparc :
- case bfd_mach_sparc_sparclet :
- case bfd_mach_sparc_sparclite :
+ case bfd_mach_sparc:
+ case bfd_mach_sparc_sparclet:
+ case bfd_mach_sparc_sparclite:
break; /* nothing to do */
- case bfd_mach_sparc_v8plus :
+ case bfd_mach_sparc_v8plus:
elf_elfheader (abfd)->e_machine = EM_SPARC32PLUS;
elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK;
elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS;
break;
- case bfd_mach_sparc_v8plusa :
+ case bfd_mach_sparc_v8plusa:
elf_elfheader (abfd)->e_machine = EM_SPARC32PLUS;
elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK;
elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS | EF_SPARC_SUN_US1;
break;
- case bfd_mach_sparc_v8plusb :
- case bfd_mach_sparc_v8plusc :
- case bfd_mach_sparc_v8plusd :
- case bfd_mach_sparc_v8pluse :
- case bfd_mach_sparc_v8plusv :
- case bfd_mach_sparc_v8plusm :
- case bfd_mach_sparc_v8plusm8 :
+ case bfd_mach_sparc_v8plusb:
+ case bfd_mach_sparc_v8plusc:
+ case bfd_mach_sparc_v8plusd:
+ case bfd_mach_sparc_v8pluse:
+ case bfd_mach_sparc_v8plusv:
+ case bfd_mach_sparc_v8plusm:
+ case bfd_mach_sparc_v8plusm8:
elf_elfheader (abfd)->e_machine = EM_SPARC32PLUS;
elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK;
elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS | EF_SPARC_SUN_US1
| EF_SPARC_SUN_US3;
break;
- case bfd_mach_sparc_sparclite_le :
+ case bfd_mach_sparc_sparclite_le:
elf_elfheader (abfd)->e_flags |= EF_SPARC_LEDATA;
break;
- default :
- abort ();
+ case 0: /* A non-sparc architecture - ignore. */
+ break;
+ default:
+ _bfd_error_handler
+ (_("%pB: unhandled sparc machine value '%lu' detected during write processing"),
+ abfd, (long) bfd_get_mach (abfd));
break;
}
}