]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg PeiCore: Add error message to describe PEIM load failure
authorLiming Gao <liming.gao@intel.com>
Thu, 8 Feb 2018 08:18:39 +0000 (16:18 +0800)
committerLiming Gao <liming.gao@intel.com>
Mon, 26 Feb 2018 05:18:40 +0000 (13:18 +0800)
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 <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Core/Pei/Image/Image.c

index 198541128512318af8a8c6fa0c53ae0718c9847b..f41d3acac77e41a853111148f11813812bf5321b 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Pei Core Load Image Support\r
 \r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -506,6 +506,9 @@ LoadAndRelocatePeCoffImage (
   //\r
   Status = PeCoffLoaderLoadImage (&ImageContext);\r
   if (EFI_ERROR (Status)) {\r
+    if (ImageContext.ImageError == IMAGE_ERROR_INVALID_SECTION_ALIGNMENT) {\r
+      DEBUG ((DEBUG_ERROR, "PEIM Image Address 0x%11p doesn't meet with section alignment 0x%x.\n", (VOID*)(UINTN)ImageContext.ImageAddress, ImageContext.SectionAlignment));\r
+    }\r
     return Status;\r
   }\r
   //\r
@@ -612,6 +615,8 @@ PeiLoadImageLoadImage (
     }\r
   }\r
 \r
+  DEBUG ((DEBUG_INFO, "Loading PEIM %g\n", FileHandle));\r
+\r
   //\r
   // If memory is installed, perform the shadow operations\r
   //\r