[Skiboot] [PATCH] Load ELF64 binaries correctly

Nathan Whitehorn nwhitehorn at freebsd.org
Sat Jan 24 08:32:44 AEDT 2015

On 01/22/15 09:02, Benjamin Herrenschmidt wrote:
> On Wed, 2015-01-21 at 08:45 -0800, Nathan Whitehorn wrote:
>> The attached patch fixes the big-endian ELF64 loader in skiboot to
>> handle the fact that the ELF entry point is specified to point to a
>> function descriptor describing the entry point rather than the entry
>> point itself. (I haven't set it up to load the TOC base pointer though)
>> This is required to load the FreeBSD kernel as a skiboot payload. The
>> patch does not touch the little-endian loader since I'm not sure if the
>> ELFv2 spec still has function descriptors or not.
> An additional problem is that the Linux 64-bit BE kernel vmlinux doesn't
> have a correct function descriptor as an entry point :-( So that patch
> breaks loading a raw BE vmlinux... We probably need a quirk to recognize
> such an image, possibly via the fact that the value that would be in the
> function descriptor cannot possibly be a valid entry point as part of
> the image.

That's unfortunate. Seeing if the descriptor points into an ELF segment 
marked executable or not shouldn't be that bad, though. I can get coded 
up soon. An alternative would be to change the FreeBSD kernel's entry 
point so that it behaves like Linux, but I would prefer not to do that 
if possible since it could be an upgrade headache for our users.

> As for LE, there are no descriptors.

OK. The LE ABI seems to have removing all the "weirdness" from ppc64 
that it can, so that's what I suspected might be the case.

> Cheers,
> Ben.
>> -Nathan
>> _______________________________________________
>> Skiboot mailing list
>> Skiboot at lists.ozlabs.org
>> https://lists.ozlabs.org/listinfo/skiboot

More information about the Skiboot mailing list