public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure
@ 2018-02-08  8:18 Liming Gao
  2018-02-08  9:30 ` Laszlo Ersek
  2018-02-08 10:11 ` Zeng, Star
  0 siblings, 2 replies; 10+ messages in thread
From: Liming Gao @ 2018-02-08  8:18 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng

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>
---
 MdeModulePkg/Core/Pei/Image/Image.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c
index 1985411..f41d3ac 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.<BR>
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
 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
   //
-- 
2.8.0.windows.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-02-15 20:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-08  8:18 [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure Liming Gao
2018-02-08  9:30 ` Laszlo Ersek
2018-02-08 10:24   ` Gao, Liming
2018-02-08 10:31     ` Laszlo Ersek
2018-02-15 20:20       ` Brian J. Johnson
2018-02-08 10:11 ` Zeng, Star
2018-02-08 10:24   ` Gao, Liming
2018-02-08 10:30     ` Zeng, Star
2018-02-08 10:39       ` Gao, Liming
2018-02-09  2:03         ` Zeng, Star

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox