[edk2-devel] [PATCH v2 2/3] UefiPayloadPkg: Add PayloadLoaderPeim which can load ELF payload

Ni, Ray ray.ni at intel.com
Thu Jun 10 03:40:17 UTC 2021


> > Without the ParseStatus field, callee cannot know whether ParseElfImage()
> is called.
> 
> It can by function contracts, the caller guarantees it. I.e. with the PE
> library I linked, no other function must be called before the init function.
> Your "ParseElfImage" function is very similar. The context is
> initialized by it, i.e. it is trash if it is not called, i.e. it must be
> called before other functions.
> If it is called, which we know, the caller has the return status. For
> PE, it means the caller must not proceed with any further PE processing
> and abort immediately.
> Is there any scenario where this does not work for ELF? Sorry if I
> missed something.

Caller might call LoadElfImage() without firstly calling ParseElfImage() by mistake.
ParseStatus is added to catch such mistake.

I don't trust the caller would follow the contracts properly😊.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#76316): https://edk2.groups.io/g/devel/message/76316
Mute This Topic: https://groups.io/mt/83277976/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list