diff options
author | Star Zeng <star.zeng@intel.com> | 2015-03-18 08:47:47 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@Edk2> | 2015-03-18 08:47:47 +0000 |
commit | 32a81741dbc91c041ca57d600526ca9c088440ff (patch) | |
tree | 4ac506e3ea6e452817746d7e52e99e25ec67cd84 /MdeModulePkg/Universal/Acpi | |
parent | 2594a98e41617ecfd5d2e3126864b4649d09a803 (diff) | |
download | edk2-32a81741dbc91c041ca57d600526ca9c088440ff.zip edk2-32a81741dbc91c041ca57d600526ca9c088440ff.tar.gz edk2-32a81741dbc91c041ca57d600526ca9c088440ff.tar.bz2 |
MdeModulePkg BootScriptExecutorDxe: Use ImageContext.ImageSize to allocate memory for PE image
to handle the case PE file alignment is not same as PE section alignment.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17063 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Acpi')
-rw-r--r-- | MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c index 3fbdf5c..97df37b 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/ScriptExecute.c @@ -4,7 +4,7 @@ This driver is dispatched by Dxe core and the driver will reload itself to ACPI reserved memory
in the entry point. The functionality is to interpret and restore the S3 boot script
-Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -307,7 +307,11 @@ ReadyToLockEventNotify ( //
Status = PeCoffLoaderGetImageInfo (&ImageContext);
ASSERT_EFI_ERROR (Status);
- Pages = EFI_SIZE_TO_PAGES(BufferSize + ImageContext.SectionAlignment);
+ if (ImageContext.SectionAlignment > EFI_PAGE_SIZE) {
+ Pages = EFI_SIZE_TO_PAGES (ImageContext.ImageSize + ImageContext.SectionAlignment);
+ } else {
+ Pages = EFI_SIZE_TO_PAGES (ImageContext.ImageSize);
+ }
FfsBuffer = 0xFFFFFFFF;
Status = gBS->AllocatePages (
AllocateMaxAddress,
|