From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.10717.1660614577294868510 for ; Mon, 15 Aug 2022 18:49:37 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=k1sBDZK+; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: michael.d.kinney@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660614577; x=1692150577; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SnfgDVaBzzRilGrWagD0taxmMb3tVRO/1gCzVv+vhAg=; b=k1sBDZK+FaaY/pG++pEbI81qTtsFJYI99QdBL2oy/5Z0bKlK7YIucfZe eZz1JJ0/fQhEoMhNj1OCWc6vCJDAGiFeu6QYZWitLaOBUCLkJBzP//npt SbLRKS3NFWiK1iMaHP7nno90GpXAOxhPQGE1RXQeRYhmIr9NlBGWCcUdg jgkCGTBU9wGkO/fHt+UkaVw0jhv65VqPdDnzrHMTkd0aHTDIotMoysk2Q +xpe1s1TTblpZjd7tkhQXkjtt7IXXbpAIptBRjrH7FJCJTaJRJCd0zg/s SOU0uknX+Z6bqs/jLTSw/DME3cpIZsGbjHSN65oW6PpnGgMyK99Q07Juw Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="275154347" X-IronPort-AV: E=Sophos;i="5.93,239,1654585200"; d="scan'208";a="275154347" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Aug 2022 18:49:37 -0700 X-IronPort-AV: E=Sophos;i="5.93,239,1654585200"; d="scan'208";a="603362913" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.251.26.67]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Aug 2022 18:49:36 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Konstantin Aladyshev , Bob Feng , Liming Gao , Yuwei Chen Subject: [Patch edk2-stable202208 1/2] BaseTools/Source/C/GenSec: Preserve prior behavior when no GUID provided Date: Mon, 15 Aug 2022 18:49:27 -0700 Message-Id: <20220816014928.2206-2-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.37.1.windows.1 In-Reply-To: <20220816014928.2206-1-michael.d.kinney@intel.com> References: <20220816014928.2206-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4022 If no GUID value is provided with EFI_SECTION_FREEFORM_SUBTYPE_GUID then preserve the prior behavior until all downstream platforms are updated to pass in a GUID value. Cc: Konstantin Aladyshev Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Michael D Kinney --- BaseTools/Source/C/GenSec/GenSec.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/C/GenSec/GenSec.c b/BaseTools/Source/C/GenSec/GenSec.c index d86cc197cc26..191a49d99228 100644 --- a/BaseTools/Source/C/GenSec/GenSec.c +++ b/BaseTools/Source/C/GenSec/GenSec.c @@ -1752,8 +1752,7 @@ Routine Description: // Check whether there is GUID for the SubtypeGuid section // if ((SectType == EFI_SECTION_FREEFORM_SUBTYPE_GUID) && (CompareGuid (&VendorGuid, &mZeroGuid) == 0)) { - Error (NULL, 0, 1001, "Missing options", "GUID"); - goto Finish; + fprintf (stdout, "Warning: input guid value is required for section type %s\n", SectionName); } // @@ -1825,13 +1824,25 @@ Routine Description: break; case EFI_SECTION_FREEFORM_SUBTYPE_GUID: - Status = GenSectionSubtypeGuidSection ( - InputFileName, - InputFileAlign, - InputFileNum, - &VendorGuid, - &OutFileBuffer - ); + if (CompareGuid (&VendorGuid, &mZeroGuid) == 0) { + // + // Preserve existing behavior when no GUID value is provided + // + Status = GenSectionCommonLeafSection ( + InputFileName, + InputFileNum, + SectType, + &OutFileBuffer + ); + } else { + Status = GenSectionSubtypeGuidSection ( + InputFileName, + InputFileAlign, + InputFileNum, + &VendorGuid, + &OutFileBuffer + ); + } break; case EFI_SECTION_VERSION: -- 2.37.1.windows.1