Re: [PATCH v4 03/13] sim/erc32: Switched emulated memory to host endian order.

Jiri Gaisler
2015-03-24T09:39:24Z

[-- Attachment #1: Type: text/plain, Size: 769 bytes --]

On 23/03/15 03:45, Mike Frysinger wrote:
> On 17 Mar 2015 22:02, Jiri Gaisler wrote:
>> --- a/sim/erc32/erc32.c
>> +++ b/sim/erc32/erc32.c

>> sregs.freq = freq ? freq : 15;
>> termsave = fcntl(0, F_GETFL, 0);
>> INIT_DISASSEMBLE_INFO(dinfo, stdout,(fprintf_ftype)fprintf);
>> +#ifdef HOST_LITTLE_ENDIAN
>> + dinfo.endian = BFD_ENDIAN_LITTLE;
>> +#else
>> dinfo.endian = BFD_ENDIAN_BIG;
>> +#endif
>
> can't you get the target endian info via the bfd library ?

bfd can tell me the byte order of the data sections in a file,
but not how the data is actually stored in the memory of the host.
Since sis always stores in host order, dinfo.endian must have
the order of the host, and not the bfd order of a file.

Jiri.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]