From nobody Wed May 8 09:00:32 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+46651+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46651+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1567387869; cv=none; d=zoho.com; s=zohoarc; b=nDg7pN09Y9xyMMrMPf2T/vCJm4Lr9Z6IENu/jQsthocrPRXT7w9iskuYdDSPWLDdyeS3DoCLsb/at1l616F9Jz6By4m/WluD4QD2DMu+wYJY3vXHxSXzsDQghEOWgWZPAvlpvQBYtewXa+SVouaMNI5LSR4CWyWV6YXkhMHAF2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567387869; h=Cc:Date:From:List-Id:List-Unsubscribe:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=ZKcEhAVXpenPdpte95B9Ljd5RnQZjlUSoNdqdf259y0=; b=ZZwqw0zRaLAkbSVj69Ogk6JyWyrr2kCF8NL5YA59vb09fJh+dD+oC7apyFLZaUUstMWNMgaMbmxF6Qw1W50JjTMJaklb1s5SiJ/fkqynnDKDMC4dSHxo/D3/rLkfdGVuah/jHuD/KhFNnVfMZd/iPbM70/u9jXFNdx1geVLHk3M= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+46651+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1567387869421339.9607926615438; Sun, 1 Sep 2019 18:31:09 -0700 (PDT) Return-Path: X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Sun, 01 Sep 2019 18:31:08 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Sep 2019 18:31:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,457,1559545200"; d="scan'208";a="193928880" X-Received: from lgao4-mobl1.ccr.corp.intel.com ([10.255.29.242]) by orsmga002.jf.intel.com with ESMTP; 01 Sep 2019 18:31:06 -0700 From: "Liming Gao" To: devel@edk2.groups.io Cc: Bob Feng Subject: [edk2-devel] [Patch] BaseTools: Update GenFw tool to support -e -z option together Date: Mon, 2 Sep 2019 09:31:02 +0800 Message-Id: <20190902013102.20696-1-liming.gao@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,liming.gao@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1567387869; bh=k2AbyttFI+by4wmDo2BDgEZ0P2AjA3hLG/15IPTSsXQ=; h=Cc:Date:From:Reply-To:Subject:To; b=JlCynf7+J9ZGvlOC/FrWSH8IQ5Yhsmwe/SxOXAZIg3BX//KVNNgZVw1miJLe5lbFPt1 zzSahmH7TdmxRXqjgoPLKFq19un1pHWGHoNoOMYUbNv8zpbclLd0krhvVBzwQPTooHslU b17O/BWOBkSitlGch6KFfC+mdUljY1EHv1Y= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: 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/Ge= nFw.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; =20 SetUtilityName (UTILITY_NAME); =20 @@ -1158,6 +1159,7 @@ Returns: NegativeAddr =3D FALSE; InputFileTime =3D 0; OutputFileTime =3D 0; + ZeroDebugFlag =3D FALSE; =20 if (argc =3D=3D 1) { Error (NULL, 0, 1001, "Missing options", "No input options."); @@ -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: } =20 if ((stricmp (argv[0], "-t") =3D=3D 0) || (stricmp (argv[0], "--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: } =20 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); =20 if (mOutImageType =3D=3D FW_TE_IMAGE) { if ((PeHdr->Pe32.FileHeader.NumberOfSections &~0xFF) || (Type &~0xFF))= { --=20 2.13.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46651): https://edk2.groups.io/g/devel/message/46651 Mute This Topic: https://groups.io/mt/33107042/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-