From: Liming Gao Date: Thu, 8 Feb 2018 08:18:39 +0000 (+0800) Subject: MdeModulePkg PeiCore: Add error message to describe PEIM load failure X-Git-Tag: edk2-stable201903~2337 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=63c677e20f4e2645fab72fef56a8ca1d20f84bef MdeModulePkg PeiCore: Add error message to describe PEIM load failure If PEIM image address doesn't meet with its section alignment, it will load fail. PeiCore adds more debug message to report it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Cc: Star Zeng Reviewed-by: Star Zeng --- diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c index 1985411285..f41d3acac7 100644 --- a/MdeModulePkg/Core/Pei/Image/Image.c +++ b/MdeModulePkg/Core/Pei/Image/Image.c @@ -1,7 +1,7 @@ /** @file Pei Core Load Image Support -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage ( // Status = PeCoffLoaderLoadImage (&ImageContext); if (EFI_ERROR (Status)) { + if (ImageContext.ImageError == IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) { + DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet with section alignment 0x%x.\n", (VOID*)(UINTN)ImageContext.ImageAddress, ImageContext.SectionAlignment)); + } return Status; } // @@ -612,6 +615,8 @@ PeiLoadImageLoadImage ( } } + DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle)); + // // If memory is installed, perform the shadow operations //