]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg: DxeCore: fully initialize image context before passing it on
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 29 Feb 2016 16:08:45 +0000 (17:08 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 1 Mar 2016 09:15:59 +0000 (10:15 +0100)
commit1cf4e9339de98a2a2a2b803f142993d776d9203d
treefe814d2d413a78d174c0772ce84b165a33028bc0
parent48d97c8b5814e47ede7bf3a24a0f6c525439b27e
MdeModulePkg: DxeCore: fully initialize image context before passing it on

When the DXE core is loaded, it invokes the PeCoffExtraActionLib library
function 'PeCoffLoaderRelocateImageExtraAction' explicitly, which may be
in addition to the same function having been called by the DxeIpl PE/COFF
loader instance.

The ImageContext that DXE core presents to this function is only partially
initialized, which may result in the following output on AArch64 systems:

add-symbol-file ..MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll 0x5F226240
<some intermediate output>
add-symbol-file ..MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll 0x5F226000

This is caused by incorrect data in the ImageContext structure, which means
the start of the .text section is calculated incorrectly. In general, it is
the duty of the caller to present a valid ImageContext structure, so let's
add the missing values before invoking PeCoffLoaderRelocateImageExtraAction().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c