From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: bob.c.feng@intel.com) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by groups.io with SMTP; Tue, 03 Sep 2019 18:41:41 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 18:41:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,465,1559545200"; d="scan'208";a="184951880" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 03 Sep 2019 18:41:38 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 3 Sep 2019 18:41:29 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 3 Sep 2019 18:41:28 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.89]) with mapi id 14.03.0439.000; Wed, 4 Sep 2019 09:41:26 +0800 From: "Bob Feng" To: "Gao, Liming" , "devel@edk2.groups.io" Subject: Re: [edk2-devel] [Patch] BaseTools: Update GenFw tool to support -e -z option together Thread-Topic: [edk2-devel] [Patch] BaseTools: Update GenFw tool to support -e -z option together Thread-Index: AQHVYS4bDwFIp1tLwkyshuv6UfH+k6cateVA//9/pwCAAIuJoA== Date: Wed, 4 Sep 2019 01:41:26 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D16152FF20@SHSMSX104.ccr.corp.intel.com> References: <20190902013102.20696-1-liming.gao@intel.com> <08650203BA1BD64D8AD9B6D5D74A85D16152FCF0@SHSMSX104.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E4F2109@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4F2109@SHSMSX104.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks, with the change, Reviewed-by: Bob Feng -----Original Message----- From: Gao, Liming=20 Sent: Wednesday, September 4, 2019 9:21 AM To: Feng, Bob C ; devel@edk2.groups.io Subject: RE: [edk2-devel] [Patch] BaseTools: Update GenFw tool to support = -e -z option together Yes. Thanks for your comments. I will update it and push the change.=20 Thanks Liming >-----Original Message----- >From: Feng, Bob C >Sent: Wednesday, September 04, 2019 9:03 AM >To: devel@edk2.groups.io; Gao, Liming >Subject: RE: [edk2-devel] [Patch] BaseTools: Update GenFw tool to=20 >support -e -z option together > >Liming, > >The patch looks good to me. > >A minor comment that the code looks fix the bug of the combinations of=20 >-e -z and -t -z, so would you please update the commit message to add "-t= -z" > >Thanks, >Bob > >-----Original Message----- >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of=20 >Liming Gao >Sent: Monday, September 2, 2019 9:31 AM >To: devel@edk2.groups.io >Cc: Feng, Bob C >Subject: [edk2-devel] [Patch] BaseTools: Update GenFw tool to support=20 >-e -z option together > >BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1727 >-e -z option is to generate EFI image with zero debug entry. >It can be used to check the EFI image in DEBUG build. > >Signed-off-by: Liming Gao >Cc: Bob Feng >--- > BaseTools/Source/C/GenFw/GenFw.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > >diff --git a/BaseTools/Source/C/GenFw/GenFw.c >b/BaseTools/Source/C/GenFw/GenFw.c >index 973bae5fe4..c99782b78e 100644 >--- a/BaseTools/Source/C/GenFw/GenFw.c >+++ b/BaseTools/Source/C/GenFw/GenFw.c >@@ -1111,6 +1111,7 @@ Returns: > time_t InputFileTime; > time_t OutputFileTime; > struct stat Stat_Buf; >+ BOOLEAN ZeroDebugFlag; > > SetUtilityName (UTILITY_NAME); > >@@ -1158,6 +1159,7 @@ Returns: > NegativeAddr =3D FALSE; > InputFileTime =3D 0; > OutputFileTime =3D 0; >+ ZeroDebugFlag =3D FALSE; > > if (argc =3D=3D 1) { > Error (NULL, 0, 1001, "Missing options", "No input options."); @@=20 > -1197,6 >+1199,9 @@ Returns: > goto Finish; > } > ModuleType =3D argv[1]; >+ if (mOutImageType =3D=3D FW_ZERO_DEBUG_IMAGE) { >+ ZeroDebugFlag =3D TRUE; >+ } > if (mOutImageType !=3D FW_TE_IMAGE) { > mOutImageType =3D FW_EFI_IMAGE; > } >@@ -1220,6 +1225,9 @@ Returns: > } > > if ((stricmp (argv[0], "-t") =3D=3D 0) || (stricmp (argv[0],=20 > "--terse") =3D=3D 0)) { >+ if (mOutImageType =3D=3D FW_ZERO_DEBUG_IMAGE) { >+ ZeroDebugFlag =3D TRUE; >+ } > mOutImageType =3D FW_TE_IMAGE; > argc --; > argv ++; >@@ -1241,7 +1249,12 @@ Returns: > } > > if ((stricmp (argv[0], "-z") =3D=3D 0) || (stricmp (argv[0], "--zero= ") =3D=3D 0)) { >- mOutImageType =3D FW_ZERO_DEBUG_IMAGE; >+ if (mOutImageType =3D=3D FW_DUMMY_IMAGE) { >+ mOutImageType =3D FW_ZERO_DEBUG_IMAGE; >+ } >+ if (mOutImageType =3D=3D FW_TE_IMAGE || mOutImageType =3D=3D >FW_EFI_IMAGE) { >+ ZeroDebugFlag =3D TRUE; >+ } > argc --; > argv ++; > continue; >@@ -2588,7 +2601,7 @@ Returns: > // > // Zero Time/Data field > // >- ZeroDebugData (FileBuffer, FALSE); >+ ZeroDebugData (FileBuffer, ZeroDebugFlag); > > if (mOutImageType =3D=3D FW_TE_IMAGE) { > if ((PeHdr->Pe32.FileHeader.NumberOfSections &~0xFF) || (Type=20 >&~0xFF)) { >-- >2.13.0.windows.1 > > >