From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: liming.gao@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Tue, 03 Sep 2019 18:21:03 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 18:21:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,465,1559545200"; d="scan'208";a="182320239" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga008.fm.intel.com with ESMTP; 03 Sep 2019 18:21:03 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) 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:21:02 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 3 Sep 2019 18:21:02 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.32]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.146]) with mapi id 14.03.0439.000; Wed, 4 Sep 2019 09:21:00 +0800 From: "Liming Gao" To: "Feng, Bob C" , "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: AQHVYS4b2xbRQsDATEC3lhyjSH6rQqcateVAgAAFqCA= Date: Wed, 4 Sep 2019 01:21:00 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4F2109@SHSMSX104.ccr.corp.intel.com> References: <20190902013102.20696-1-liming.gao@intel.com> <08650203BA1BD64D8AD9B6D5D74A85D16152FCF0@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <08650203BA1BD64D8AD9B6D5D74A85D16152FCF0@SHSMSX104.ccr.corp.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 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 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 -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 >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 -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."); @@ -1= 197,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], "--ters= e") =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 &~0xFF= )) >{ >-- >2.13.0.windows.1 > > >