From nobody Fri May 3 22:23:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+65441+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65441+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1600774079; cv=none; d=zohomail.com; s=zohoarc; b=BPmAX+rbxcrP6Y3bBQMV3MBcRj+4GFhSjFH0Xhpcg9ZPYw3IkELUHgK7nNTJKmjgnl8RaiEuBIzrodlXncpwbbFffeuJS5Z5a3Ll/9FetI3/5HcIbJ3bhrCUgYFZQR8NgyDfren0LjmViJj99qA6VGMlAygXNcOTvt6Jlfxwjzg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600774079; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=IUweyshan7xDw0cVVV1yjkfG17F4YR8l6+Y39w/XbQo=; b=Dkp7yYvNOatVaI26AGFdE+xFPI670wmA2KzD/W3f9AmfDRgQ8xDSMA8nUfijPxSJyXb8QikNvu+glW4cZkZOsgi+t3P019ldNQWJjkOeYTm7dLLjA0fA7Bfeex7l3pCjpzpQnTHekcw2B188UMtPg9hamVhFwecs/DAl9sOaWBQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+65441+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 160077407979853.485646021097295; Tue, 22 Sep 2020 04:27:59 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id J5nIYY1788612xzNJxdMgTHS; Tue, 22 Sep 2020 04:27:59 -0700 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.6077.1600774078344557922 for ; Tue, 22 Sep 2020 04:27:58 -0700 IronPort-SDR: VcGW3PpkLU3zLJ/J3fpXIZCNnuXSDVuPgIVb+0vLt4OyewPehSMvAWA6aYwNXyyaevV4A0xXZ5 0ToLnCwhdIsA== X-IronPort-AV: E=McAfee;i="6000,8403,9751"; a="161508102" X-IronPort-AV: E=Sophos;i="5.77,290,1596524400"; d="scan'208";a="161508102" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2020 04:27:57 -0700 IronPort-SDR: fdZvmL0DUS0eYaL0QRQq/9aLkc0f6OB0tuOAZjcI3DmHWZTkWWJcFw1nP61/aCgt2VClIHQGBj KQDu6HeZcT3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,290,1596524400"; d="scan'208";a="334969086" X-Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.66]) by fmsmga004.fm.intel.com with ESMTP; 22 Sep 2020 04:27:56 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Liming Gao , Yuwei Chen Subject: [edk2-devel] [Patch] BaseTools: Set section alignment as zero if its type is Auto Date: Tue, 22 Sep 2020 19:27:54 +0800 Message-Id: <20200922112754.36396-1-bob.c.feng@intel.com> MIME-Version: 1.0 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,bob.c.feng@intel.com X-Gm-Message-State: Ht6Fmu9InLpLl9C86THHNVbux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1600774079; bh=eZyZlEhlmIcPIDQ/XSIxm195tx17Ze2cw2Kjge2kULw=; h=Cc:Date:From:Reply-To:Subject:To; b=L3b67UVjvAdlzEoY2W7dQCnrd1ywXVJym/IpVApslFR0j3GpYlRhV5VXPfZGO6QTB2h feIIINWJZnrFC/p4JbRPcDr+d+LsjUDe0mKxC/oyGTUhdFniVYJCE9FqGW4CiIkwBmIsw CNoaoWkn5YGVqH9Ryw42imNKtBBz/FB6D5s= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2881 Currently, the build tool try to read the section alignment from efi file if the section alignment type is Auto. If there is no efi generated, the section alignment will be set to zero. This behavior causes the Makefile to be different between the full build and the incremental build. Since the Genffs can auto get the section alignment from efi file during Genffs procedure, the build tool can just set section alignment as zero. This change can make the autogen makefile consistent for the full build and the incremental build. Signed-off-by: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Reviewed-by: Liming Gao Reviewed-by: Yuwei Chen --- BaseTools/Source/Python/GenFds/DataSection.py | 9 +-------- BaseTools/Source/Python/GenFds/EfiSection.py | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/BaseTools/Source/Python/GenFds/DataSection.py b/BaseTools/Sour= ce/Python/GenFds/DataSection.py index f20fd70225..5af3ee7b7f 100644 --- a/BaseTools/Source/Python/GenFds/DataSection.py +++ b/BaseTools/Source/Python/GenFds/DataSection.py @@ -78,18 +78,11 @@ class DataSection (DataSectionClassObject): if not os.path.exists(CopyMapFile) or (os.path.getmtim= e(MapFile) > os.path.getmtime(CopyMapFile)): CopyLongFilePath(MapFile, CopyMapFile) =20 #Get PE Section alignment when align is set to AUTO if self.Alignment =3D=3D 'Auto' and self.SecType in (BINARY_FILE_T= YPE_TE, BINARY_FILE_TYPE_PE32): - ImageObj =3D PeImageClass (Filename) - if ImageObj.SectionAlignment < 0x400: - self.Alignment =3D str (ImageObj.SectionAlignment) - elif ImageObj.SectionAlignment < 0x100000: - self.Alignment =3D str (ImageObj.SectionAlignment // 0x400= ) + 'K' - else: - self.Alignment =3D str (ImageObj.SectionAlignment // 0x100= 000) + 'M' - + self.Alignment =3D "0" NoStrip =3D True if self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32): if self.KeepReloc is not None: NoStrip =3D self.KeepReloc =20 diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py b/BaseTools/Sourc= e/Python/GenFds/EfiSection.py index e7d4639041..fd58391dac 100644 --- a/BaseTools/Source/Python/GenFds/EfiSection.py +++ b/BaseTools/Source/Python/GenFds/EfiSection.py @@ -258,18 +258,11 @@ class EfiSection (EfiSectionClassObject): OutputFile =3D os.path.join( OutputPath, ModuleName + = SUP_MODULE_SEC + Num + SectionSuffix.get(SectionType)) File =3D GenFdsGlobalVariable.MacroExtend(File, Dict) =20 #Get PE Section alignment when align is set to AUTO if self.Alignment =3D=3D 'Auto' and (SectionType =3D= =3D BINARY_FILE_TYPE_PE32 or SectionType =3D=3D BINARY_FILE_TYPE_TE): - ImageObj =3D PeImageClass (File) - if ImageObj.SectionAlignment < 0x400: - Align =3D str (ImageObj.SectionAlignment) - elif ImageObj.SectionAlignment < 0x100000: - Align =3D str (ImageObj.SectionAlignment // 0x= 400) + 'K' - else: - Align =3D str (ImageObj.SectionAlignment // 0x= 100000) + 'M' - + Align =3D "0" if File[(len(File)-4):] =3D=3D '.efi' and FfsInf.InfMo= dule.BaseName =3D=3D os.path.basename(File)[:-4]: MapFile =3D File.replace('.efi', '.map') CopyMapFile =3D os.path.join(OutputPath, ModuleNam= e + '.map') if IsMakefile: if GenFdsGlobalVariable.CopyList =3D=3D []: --=20 2.20.1.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 (#65441): https://edk2.groups.io/g/devel/message/65441 Mute This Topic: https://groups.io/mt/77010875/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-