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.24; helo=mga09.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 23C2420955F06 for ; Sun, 25 Feb 2018 23:35:59 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2018 23:42:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,396,1515484800"; d="scan'208";a="34137754" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 25 Feb 2018 23:42:01 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 25 Feb 2018 23:42:00 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 25 Feb 2018 23:42:00 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.253]) with mapi id 14.03.0319.002; Mon, 26 Feb 2018 15:41:58 +0800 From: "Zhu, Yonghong" To: "Gao, Liming" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: Update GenFw to correct DebugEntry Offset when convert XIP image Thread-Index: AQHTrsX8E3MlPeYqBUWH2Z8tNLaaaqO2TPSw Date: Mon, 26 Feb 2018 07:41:58 +0000 Message-ID: References: <1519624304-1544-1-git-send-email-liming.gao@intel.com> In-Reply-To: <1519624304-1544-1-git-send-email-liming.gao@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Mon, 26 Feb 2018 07:36:00 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Limi= ng Gao Sent: Monday, February 26, 2018 1:52 PM To: edk2-devel@lists.01.org Subject: [edk2] [Patch] BaseTools: Update GenFw to correct DebugEntry Offse= t when convert XIP image DebugEntry FileOffset is required to be updated to the virtual address if t= he input image is converted to XIP image. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao --- 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)); -- 2.8.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel