summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core/Pei
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-10-22 10:41:03 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-10-22 10:41:03 +0000
commit4e844595f27ba8031b1b72fb3e3ab16bcf246ebc (patch)
treef26f669df6bf474b0c25cfedd1f155bc2f6882c3 /MdeModulePkg/Core/Pei
parent8e5b17b25e91ffa293c1cbcb30e1c6997c6bdecd (diff)
downloadedk2-platforms-4e844595f27ba8031b1b72fb3e3ab16bcf246ebc.tar.xz
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/Core/Pei')
-rw-r--r--MdeModulePkg/Core/Pei/Image/Image.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c
index c13a869d2c..c9805f5311 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