This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Endian bug disassembling SH4 code from binary ??


armcc@lycos.com wrote:
> Original host and toolchain configuration were both little endian.
> After adding an explicit -EL to the objdump command line I do get the
> correct disassembly.
> 
> Seems like 'objdump -b binary' defaults to big endian in all cases ??

I thought that the all binutils tools decide which endian
should be used based on the object that the tool is handling.
There is the "default object type" for almost tools decided
with the default emulation vectors, but it seems that there
is basically no default endian for the tool itself.

I've tried armeb-elf and mipseb-elf toolchains and found
that their objdump treat the objects with the binary format
as if the little endian is default on them.
The data of the binary format object which has the unknown
endian is displayed as the big endian data in the SH case,
because opcodes/sh-dis.c:print_insn_sh treats the unknown
endian as the big endian.

We could change it so to take account of the endian given by
the default emulation vectors, for example, though I feel that
guessing the "endian of a pure binary object" from how the tool
was configured is dubious.

Regards,
	kaz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]