[edk2-devel] [PATCH] UefiPayloadPkg: Fix bug that Elf loader doesn't relocate in some case

Ni, Ray ray.ni at intel.com
Mon Apr 11 02:05:20 UTC 2022


With the updated commit message, Reviewed-by: Ray Ni <ray.ni at Intel.com> 

> -----Original Message-----
> From: Liu, Zhiguang <zhiguang.liu at intel.com>
> Sent: Thursday, April 7, 2022 8:57 AM
> To: Ni, Ray <ray.ni at intel.com>; devel at edk2.groups.io
> Cc: Dong, Guo <guo.dong at intel.com>; Ma, Maurice <maurice.ma at intel.com>; You, Benjamin <benjamin.you at intel.com>;
> Rhodes, Sean <sean at starlabs.systems>
> Subject: RE: [PATCH] UefiPayloadPkg: Fix bug that Elf loader doesn't relocate in some case
> 
> Sorry, it is a typo. the example should be
> The first segment is located at 0x1000, and the desired address is 0x2000.
> The second segment is located at 0x2000, and the desired address is 0x1000.
> The current ELF loader may copy first segment to 0x2000, which will erase the second segment.
> 
> Thanks
> Zhiguang
> 
> 
> > -----Original Message-----
> > From: Ni, Ray <ray.ni at intel.com>
> > Sent: Thursday, April 7, 2022 8:06 AM
> > To: Liu, Zhiguang <zhiguang.liu at intel.com>; devel at edk2.groups.io
> > Cc: Dong, Guo <guo.dong at intel.com>; Ma, Maurice <maurice.ma at intel.com>;
> > You, Benjamin <benjamin.you at intel.com>; Rhodes, Sean
> > <sean at starlabs.systems>
> > Subject: RE: [PATCH] UefiPayloadPkg: Fix bug that Elf loader doesn't relocate in
> > some case
> >
> >
> >
> > > -----Original Message-----
> > > From: Liu, Zhiguang <zhiguang.liu at intel.com>
> > > Sent: Wednesday, April 6, 2022 9:52 PM
> > > To: devel at edk2.groups.io
> > > Cc: Dong, Guo <guo.dong at intel.com>; Ni, Ray <ray.ni at intel.com>; Ma,
> > > Maurice <maurice.ma at intel.com>; You, Benjamin
> > > <benjamin.you at intel.com>; Rhodes, Sean <sean at starlabs.systems>
> > > Subject: [PATCH] UefiPayloadPkg: Fix bug that Elf loader doesn't
> > > relocate in some case
> > >
> > > Current implementation of the Elf loader reuses the same memory range
> > > if the desired memory range is covered by [file base, file base + file size].
> > > However, there is a potentil bug, for example:
> > > If the first segment is located at 0x1000, and the desired address is
> > > 0x2000. While the second segment is located at 0x2000, and the desired
> > > address is 0x2000. When we parse and try to load the elf file, current
> >
> > Why the desired address for both segments is 0x2000?



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#88676): https://edk2.groups.io/g/devel/message/88676
Mute This Topic: https://groups.io/mt/90289885/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