
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 04/16/2013 05:57 PM, Simon Glass wrote:
Hi Wolfgang,
On Sat, Apr 6, 2013 at 12:04 AM, Wolfgang Denk wd@denx.de wrote:
Dear Simon Glass,
In message 1365203470-9099-1-git-send-email-sjg@chromium.org you wrote:
When crc32 is handled by the hash library, it requires the data to be in big-endian format, since it reads it byte-wise. Thus at present the 'crc32' command reports incorrect data. For example, previously we might see:
+#ifdef USE_HOSTCC + crc = htobe32(crc); memcpy(output, &crc, sizeof(crc)); +#else + put_unaligned_be32(crc, output); +#endif
Why is this depending on USE_HOSTCC, and not on the endianess?
We always want big-endian in this case, since the bytes have to date been written that way by the crc32 command.
In other words, this code is executed on both the host and the target, and there's not a uniform endian sanitizer function.
- -- Tom