diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-22 10:41:03 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-10-22 10:41:03 +0000 |
commit | 4e844595f27ba8031b1b72fb3e3ab16bcf246ebc (patch) | |
tree | f26f669df6bf474b0c25cfedd1f155bc2f6882c3 /MdeModulePkg | |
parent | 8e5b17b25e91ffa293c1cbcb30e1c6997c6bdecd (diff) | |
download | edk2-4e844595f27ba8031b1b72fb3e3ab16bcf246ebc.zip edk2-4e844595f27ba8031b1b72fb3e3ab16bcf246ebc.tar.gz edk2-4e844595f27ba8031b1b72fb3e3ab16bcf246ebc.tar.bz2 |
Fix alignment requirement when Load IPF TeImage into memory.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4197 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 9 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/Image/Image.c | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c index 84b8eb2..e62142f 100644 --- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c +++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c @@ -483,6 +483,15 @@ PeiLoadFile ( ASSERT (ImageContext.ImageAddress != 0);
//
+ // Skip the reserved space for the stripped PeHeader when load TeImage into memory.
+ //
+ if (ImageContext.IsTeImage) {
+ ImageContext.ImageAddress = ImageContext.ImageAddress +
+ ((EFI_TE_IMAGE_HEADER *) Pe32Data)->StrippedSize -
+ sizeof (EFI_TE_IMAGE_HEADER);
+ }
+
+ //
// Load the image to our new buffer
//
Status = PeCoffLoaderLoadImage (&ImageContext);
diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c index c13a869..c9805f5 100644 --- a/MdeModulePkg/Core/Pei/Image/Image.c +++ b/MdeModulePkg/Core/Pei/Image/Image.c @@ -242,6 +242,15 @@ Returns: //
ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN) AllocatePages (EFI_SIZE_TO_PAGES ((UINT32) ImageContext.ImageSize));
ASSERT (ImageContext.ImageAddress != 0);
+
+ //
+ // Skip the reserved space for the stripped PeHeader when load TeImage into memory.
+ //
+ if (ImageContext.IsTeImage) {
+ ImageContext.ImageAddress = ImageContext.ImageAddress +
+ ((EFI_TE_IMAGE_HEADER *) Pe32Data)->StrippedSize -
+ sizeof (EFI_TE_IMAGE_HEADER);
+ }
//
// Load the image to our new buffer
|