From nobody Sat Apr 27 18:20:35 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1519624373430652.9562347085848; Sun, 25 Feb 2018 21:52:53 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 29DCD21F6A6CA; Sun, 25 Feb 2018 21:45:56 -0800 (PST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 2E31F2034D8C5 for ; Sun, 25 Feb 2018 21:45:54 -0800 (PST) Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2018 21:51:58 -0800 Received: from shwde7172.ccr.corp.intel.com ([10.239.9.15]) by orsmga007.jf.intel.com with ESMTP; 25 Feb 2018 21:51:58 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,396,1515484800"; d="scan'208";a="20285541" From: Liming Gao To: edk2-devel@lists.01.org Date: Mon, 26 Feb 2018 13:51:44 +0800 Message-Id: <1519624304-1544-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [edk2] [Patch] BaseTools: Update GenFw to correct DebugEntry Offset when convert XIP image 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" DebugEntry FileOffset is required to be updated to the virtual address if the input image is converted to XIP image. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/C/GenFw/GenFw.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BaseTools/Source/C/GenFw/GenFw.c b/BaseTools/Source/C/GenFw/Ge= nFw.c index 33ba917..00c9ff3 100644 --- a/BaseTools/Source/C/GenFw/GenFw.c +++ b/BaseTools/Source/C/GenFw/GenFw.c @@ -92,6 +92,7 @@ CHAR8 *mInImageName; UINT32 mImageTimeStamp =3D 0; UINT32 mImageSize =3D 0; UINT32 mOutImageType =3D FW_DUMMY_IMAGE; +BOOLEAN mIsConvertXip =3D FALSE; =20 =20 STATIC @@ -665,6 +666,8 @@ PeCoffConvertImageToXip ( free (*FileBuffer); *FileLength =3D XipLength; *FileBuffer =3D XipFile; + + mIsConvertXip =3D TRUE; } =20 UINT8 * @@ -2897,6 +2900,9 @@ Returns: Index =3D 0; for (Index=3D0; Index < DebugDirectoryEntrySize / sizeof (EFI_IMAGE_DE= BUG_DIRECTORY_ENTRY); Index ++, DebugEntry ++) { DebugEntry->TimeDateStamp =3D 0; + if (mIsConvertXip) { + DebugEntry->FileOffset =3D DebugEntry->RVA; + } if (ZeroDebugFlag || DebugEntry->Type !=3D EFI_IMAGE_DEBUG_TYPE_CODE= VIEW) { memset (FileBuffer + DebugEntry->FileOffset, 0, DebugEntry->SizeOf= Data); memset (DebugEntry, 0, sizeof (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY)); --=20 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel