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

Khem Raj raj.khem at gmail.com
Fri Oct 24 16:31:26 UTC 2014


On Fri, Oct 24, 2014 at 4:43 AM, Burton, Ross <ross.burton at intel.com> wrote:
> 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.
>

you are right. but I wonder if this patch is OK since section alignments change
based on 32bit ABI or 64bit ABI

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

I think its fine idea, I haven't paid enough attention to it so assert
if its right
for upstreaming in current shape but for 2.21 I should

>
> Ross



More information about the Openembedded-core mailing list