> > 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/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-