Bug 396

Summary: cannot assemble sparclet files
Product: binutils Reporter: Luke Diamand <luke>
Component: gasAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: bug-binutils
Priority: P2    
Version: 2.15   
Target Milestone: ---   
Host: i686-pc-linux-gnu Target: sparc-elf32
Build: Last reconfirmed:

Description Luke Diamand 2004-09-21 10:06:52 UTC
If you try to compile with -Wa,-Asparclet using gcc, then the assembler will
abort on some files (those using sparclet insns?), reporting:

BFD 2.13 internal error, aborting at
/home/lgd/isos_tools/source/gnu/binutils-2.13/bfd/elf32-sp                     
           arc.c line 2091 in elf32_sparc_final_write_processing

(This is in binutils 2.13, but it also happens in binutils 2.15, but at a
different line number - I just happen to be testing with 2.13 today).

It seems to be missing a clause in the switch statement in
elf32_sparc_final_write_processing().

My naive fix is just to add:

    case bfd_mach_sparc_sparclet :

as per the context-diff at the end of this report. I don't know enough about
binutils to know if this is the correct way to fix this problem though.


Index: elf32-sparc.c
===================================================================
RCS file: /cvsroot/isos_tools/source/gnu/binutils-2.13/bfd/elf32-sparc.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 elf32-sparc.c
*** elf32-sparc.c       17 Mar 2003 14:25:40 -0000      1.1.1.1
--- elf32-sparc.c       21 Sep 2004 10:06:06 -0000
***************
*** 2066,2071 ****
--- 2066,2072 ----
    switch (bfd_get_mach (abfd))
      {
      case bfd_mach_sparc :
+     case bfd_mach_sparc_sparclet :
        break; /* nothing to do */
      case bfd_mach_sparc_v8plus :
        elf_elfheader (abfd)->e_machine = EM_SPARC32PLUS;