From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9F3BB22361E4D for ; Thu, 8 Feb 2018 00:12:57 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Feb 2018 00:18:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,477,1511856000"; d="scan'208";a="16539841" Received: from shwde7172.ccr.corp.intel.com ([10.239.9.15]) by orsmga008.jf.intel.com with ESMTP; 08 Feb 2018 00:18:40 -0800 From: Liming Gao To: edk2-devel@lists.01.org Cc: Star Zeng Date: Thu, 8 Feb 2018 16:18:39 +0800 Message-Id: <1518077919-10176-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [Patch] MdeModulePkg PeiCore: Add error message to describe PEIM load failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Feb 2018 08:12:59 -0000 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 --- 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.
+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 // -- 2.8.0.windows.1