From 31ffa077fc8b21bfdecf4c75e2e9e2520dea0741 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Thu, 21 Apr 2016 09:47:00 +0800 Subject: MdeModulePkg DxeCore: Call PeCoffExtraActionLib member after Constructor Originally, the code block for "Report DXE Core image information to the PE/COFF Extra Action Library" was after ProcessLibraryConstructorList(). To fix an issue, ProcessLibraryConstructorList() was moved to be right after CoreInitializeGcdServices() at c5d5379937629f3061d08b8d9a3386a40152ca2c, but the code block was left. As there maybe PeCoffExtraActionLib implementation need Constructor executed first, the patch is to move the code block for "Report DXE Core image information to the PE/COFF Extra Action Library" to be after ProcessLibraryConstructorList. Cc: Jiewen Yao Cc: Liming Gao Cc: Feng Tian Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao --- MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c') diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c index 20ff02f663..a458d6b64f 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -290,19 +290,6 @@ DxeMain ( Status = CoreInitializeImageServices (HobStart); ASSERT_EFI_ERROR (Status); - // - // Report DXE Core image information to the PE/COFF Extra Action Library - // - ZeroMem (&ImageContext, sizeof (ImageContext)); - ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase; - ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*)(UINTN)ImageContext.ImageAddress); - ImageContext.SizeOfHeaders = PeCoffGetSizeOfHeaders ((VOID*)(UINTN)ImageContext.ImageAddress); - Status = PeCoffLoaderGetEntryPoint ((VOID*)(UINTN)ImageContext.ImageAddress, &EntryPoint); - if (Status == EFI_SUCCESS) { - ImageContext.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint; - } - PeCoffLoaderRelocateImageExtraAction (&ImageContext); - // // Initialize the Global Coherency Domain Services // @@ -316,6 +303,19 @@ DxeMain ( PERF_END (NULL,"PEI", NULL, 0) ; PERF_START (NULL,"DXE", NULL, 0) ; + // + // Report DXE Core image information to the PE/COFF Extra Action Library + // + ZeroMem (&ImageContext, sizeof (ImageContext)); + ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase; + ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*)(UINTN)ImageContext.ImageAddress); + ImageContext.SizeOfHeaders = PeCoffGetSizeOfHeaders ((VOID*)(UINTN)ImageContext.ImageAddress); + Status = PeCoffLoaderGetEntryPoint ((VOID*)(UINTN)ImageContext.ImageAddress, &EntryPoint); + if (Status == EFI_SUCCESS) { + ImageContext.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint; + } + PeCoffLoaderRelocateImageExtraAction (&ImageContext); + // // Install the DXE Services Table into the EFI System Tables's Configuration Table // -- cgit v1.2.3