[OE-core] [PATCH 1/1] ldconfig-native: fix a endian-ness bug

Burton, Ross ross.burton at intel.com
Fri Oct 24 11:43:58 UTC 2014


On 24 October 2014 07:05, Shan Hai <shan.hai at windriver.com> wrote:

> Some header fields of ELF were read with wrong size on 64bit
> big-endian machine, fix it by reading the fields with read64
> instead of read32.
>

For fixes like this which set of all sorts of alarm bells, please include
more justification.

>From a quick look at the code my interpretation is that the values in the
segment structure are 64-bit but they were being read using 32-bit
accessors (read32).  On a little-endian 64-bit machine (x86-64, aarch64)
when the values fit into a 32-bit value the right half was read and it
still worked.  Then someone tried a 64-bit big-endian build host (I'm
guessing is a ppc64 or mips64), and the values read are either 0 (if the
size fits in a 32-bit type) or corrupted (if larger).

Am I right?  Either way, the commit log needs to be clear - the message
should *why* it does something, not *what* it does.

Finally, do we really need to patch a fork?  We've got the full source
alongside the recipe, let's just fix it.

This also brings up the point that we really need to do something about
ldconfig-native.  CC'ing Khem, would anyone be able to liaise with upstream
and either update our fork or see if upstream would care about our need for
ldconfig-native?

Ross
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20141024/c0793dda/attachment-0002.html>


More information about the Openembedded-core mailing list