summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-04-29 09:39:18 +0200
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-04-29 16:57:50 +0200
commitdfbc039fac0dc7aabd11c9ba6e825d8171c59fa4 (patch)
tree9390722990f71e9f5428271c28456678b53972c8
parentb59e2427c2d92cfee0238d9bde7372691c2af17c (diff)
downloadedk2-dfbc039fac0dc7aabd11c9ba6e825d8171c59fa4.tar.gz
edk2-dfbc039fac0dc7aabd11c9ba6e825d8171c59fa4.tar.bz2
edk2-dfbc039fac0dc7aabd11c9ba6e825d8171c59fa4.zip
MdeModulePkg/DxeCore: set ImageContext Handle and ImageRead() fields
Set the ImageContext.Handle and ImageContext.ImageRead() fields so that PeCoffLoaderRelocateImageExtraAction() can invoke PeCoffLoaderGetImageInfo or PeCoffLoaderGetPeHeader if desired to obtain additional metadata. We will use this to create a PeCoffLoaderRelocateImageExtraAction() implementation that applies boot time strict mapping permissions to PE/COFF modules. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com>
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index 70a283bc2b..c34067e118 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -315,6 +315,8 @@ DxeMain (
if (Status == EFI_SUCCESS) {
ImageContext.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;
}
+ ImageContext.Handle = (VOID *)(UINTN)gDxeCoreLoadedImage->ImageBase;
+ ImageContext.ImageRead = PeCoffLoaderImageReadFromMemory;
PeCoffLoaderRelocateImageExtraAction (&ImageContext);
//