Endian bug disassembling SH4 code from binary ??

Nick Clifton nickc@redhat.com
Mon Jan 9 12:22:00 GMT 2006


Hi Mike,

>>> 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 ?  

Probably.  In fact for me it does it appear to work this way.  I tried 
the above test and I got the correct disassembly without having to put 
-EB on the objdump command line.  (This was using today's binutils 
sources though, not the 2.16.1 release).

Andre - what was the endianness of the host machine you used to run 
these tests ?  Also can you check to see if you still have the problem 
using an objdump built from the most recent binutils sources in the CVS 
repository ?

Cheers
   Nick





More information about the Binutils mailing list