This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [Bug gas/396] New: cannot assemble sparclet files
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: luke at diamand dot org
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 23 Sep 2004 10:14:48 +0930
- Subject: Re: [Bug gas/396] New: cannot assemble sparclet files
- References: <20040921100651.396.luke@diamand.org>
On Tue, Sep 21, 2004 at 10:06:55AM +0000, luke at diamand dot org wrote:
> If you try to compile with -Wa,-Asparclet using gcc, then the assembler will
> abort on some files (those using sparclet insns?), reporting:
[snip]
> *** 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;
>
Yeah, the idea looks OK to me. I'll go a little further, and add
sparclite too.
* elf32-sparc.c (elf32_sparc_final_write_processing): Handle
bfd_mach_sparc_sparclet and bfd_mach_sparc_sparclite. Remove
redundant assignment of EM_SPARC.
Index: bfd/elf32-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sparc.c,v
retrieving revision 1.74
diff -u -p -r1.74 elf32-sparc.c
--- bfd/elf32-sparc.c 17 Sep 2004 07:14:28 -0000 1.74
+++ bfd/elf32-sparc.c 23 Sep 2004 00:43:04 -0000
@@ -3371,6 +3371,8 @@ elf32_sparc_final_write_processing (abfd
switch (bfd_get_mach (abfd))
{
case bfd_mach_sparc :
+ case bfd_mach_sparc_sparclet :
+ case bfd_mach_sparc_sparclite :
break; /* nothing to do */
case bfd_mach_sparc_v8plus :
elf_elfheader (abfd)->e_machine = EM_SPARC32PLUS;
@@ -3389,7 +3391,6 @@ elf32_sparc_final_write_processing (abfd
| EF_SPARC_SUN_US3;
break;
case bfd_mach_sparc_sparclite_le :
- elf_elfheader (abfd)->e_machine = EM_SPARC;
elf_elfheader (abfd)->e_flags |= EF_SPARC_LEDATA;
break;
default :
--
Alan Modra
IBM OzLabs - Linux Technology Centre