This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Endian bug disassembling SH4 code from binary ??
- From: Mike Frysinger <vapier at gentoo dot org>
- To: binutils at sourceware dot org
- Cc: Daniel Jacobowitz <drow at false dot org>, armcc at lycos dot com
- Date: Sat, 7 Jan 2006 21:57:31 -0500
- Subject: Re: Endian bug disassembling SH4 code from binary ??
- References: <20051226091734.4ECD186B12@ws7-1.us4.outblaze.com> <20060108002948.GA18162@nevyn.them.org>
On Saturday 07 January 2006 19:29, Daniel Jacobowitz wrote:
> On Mon, Dec 26, 2005 at 04:17:34AM -0500, armcc@lycos.com wrote:
> > Binutils version: 2.16.1
> >
> > $ echo -ne ".text\nnop\nnop\n" > test.S
> > $ sh4-linux-uclibc-as -isa=sh4 test.S -o test.o
> > $ sh4-linux-uclibc-objcopy -O binary test.o test.bin
> > $ sh4-linux-uclibc-objdump -D -m sh4 -b binary test.bin
> >
> > 00000000 <.data>:
> > 0: 09 00 .word 0x0900 <-- Should be 'nop' !?!
> > 2: 09 00 .word 0x0900 <-- Should be 'nop' !?!
> >
> >
> > Is this a bug, or am I missing a critical objdump option ??
>
> Normally you need to specify the endianness explicitly when using -b
> binary.
shouldnt the default endian be whatever the toolchain is targeting though ?
forcing -EL on the objdump line will show the correct "nop" output, but it
seems odd that most of binutils defaults to little endian for a sh4 target
except when forcing the binary bfd format ...
-mike