From nobody Mon Dec 23 10:41:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1517901959874599.920087853623; Mon, 5 Feb 2018 23:25:59 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id C16CE2034A8A6; Mon, 5 Feb 2018 23:20:15 -0800 (PST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 14AE321F0DA4C for ; Mon, 5 Feb 2018 23:20:14 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2018 23:25:56 -0800 Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 05 Feb 2018 23:25:56 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 5 Feb 2018 23:25:55 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.124]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.116]) with mapi id 14.03.0319.002; Tue, 6 Feb 2018 15:25:54 +0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,467,1511856000"; d="dat'59?scan'59,208,59";a="25024051" From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" Thread-Topic: [PATCH] BaseTools: Fix COMPRESS alignment incorrect issue Thread-Index: AdOfG7h9PhdGrMQvRTSbzO5JY9O+WQ== Date: Tue, 6 Feb 2018 07:25:53 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC482A761@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC482A761@shsmsx102.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: [edk2] [PATCH] BaseTools: Fix COMPRESS alignment incorrect issue 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: , Cc: "Gao, Liming" Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Doesn't generate the correct alignment for the leaf section in the compression section. Below FFS rule doesn't work as the expectation. [Rule.Common.PEIM.PE32] FILE PEIM =3D $(NAMED_GUID) { PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex COMPRESS { PE32 PE32 Align=3DAuto $(INF_OUTPUT)/$(MODULE_NAME).efi UI STRING=3D"$(MODULE_NAME)" Optional VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) } } Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng Reviewed-by: Yonghong Zhu =20 --- BaseTools/Source/Python/GenFds/CompressSection.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/BaseTools/Source/Python/GenFds/CompressSection.py b/BaseTools/= Source/Python/GenFds/CompressSection.py index 64ad275d83..98532ed8e6 100644 --- a/BaseTools/Source/Python/GenFds/CompressSection.py +++ b/BaseTools/Source/Python/GenFds/CompressSection.py @@ -59,18 +59,32 @@ class CompressSection (CompressSectionClassObject) : self.CompType =3D FfsInf.__ExtendMacro__(self.CompType) self.Alignment =3D FfsInf.__ExtendMacro__(self.Alignment) =20 SectFiles =3D tuple() Index =3D 0 + MaxAlign =3D None for Sect in self.SectionList: Index =3D Index + 1 SecIndex =3D '%s.%d' %(SecNum, Index) ReturnSectList, AlignValue =3D Sect.GenSection(OutputPath, Mod= uleName, SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=3DIsMakefile) + if AlignValue !=3D None: + if MaxAlign =3D=3D None: + MaxAlign =3D AlignValue + if GenFdsGlobalVariable.GetAlignment (AlignValue) > GenFds= GlobalVariable.GetAlignment (MaxAlign): + MaxAlign =3D AlignValue if ReturnSectList !=3D []: + if AlignValue =3D=3D None: + AlignValue =3D "1" for FileData in ReturnSectList: SectFiles +=3D (FileData,) =20 + if MaxAlign !=3D None: + if self.Alignment =3D=3D None: + self.Alignment =3D MaxAlign + else: + if GenFdsGlobalVariable.GetAlignment (MaxAlign) > GenFdsGl= obalVariable.GetAlignment (self.Alignment): + self.Alignment =3D MaxAlign =20 OutputFile =3D OutputPath + \ os.sep + \ ModuleName + \ 'SEC' + \ --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel