From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.9620.1600924778880261217 for ; Wed, 23 Sep 2020 22:19:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Ltpftq4W; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: yuwei.chen@intel.com) IronPort-SDR: TK533qMHGVlAgybt1qG64Jw8Bn9ei6RBzxqDP7a2umyVpckChDguJpr3KxEKPVeT3VCOt4ZiX3 jZDWe3s4j2sw== X-IronPort-AV: E=McAfee;i="6000,8403,9753"; a="225241081" X-IronPort-AV: E=Sophos;i="5.77,296,1596524400"; d="scan'208";a="225241081" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 22:19:37 -0700 IronPort-SDR: IUSYi3d6wsQwlmCrhtAgGMBz5sLIDvGPwYpns760BphT8g71Phrm9o0Zv51nUIisFQuIZhFaMM czCaIl3rII5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,296,1596524400"; d="scan'208";a="486750079" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga005.jf.intel.com with ESMTP; 23 Sep 2020 22:19:37 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 23 Sep 2020 22:19:37 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 23 Sep 2020 22:19:36 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 23 Sep 2020 22:19:36 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Wed, 23 Sep 2020 22:19:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VZMk3iRTMPEHSzeZdUQXYHdD9jJ9Hl5pDWfLDJGzN/F2YzXARjGJs19Binn0MLRwfUQGU1i7UQbJJDwZ/AUDo8wtr6f6pxj+L+90LaHGulhxzRLXRjTPyA38jeFwlFm10lun2USInqVJlVRNwW1FXfDOHrurT6+LjwjsUBEDtGQ6c7S9zx/0PLozY8oaXCRTC6XessnDA0JnW3brJawhKHSWiqnib6y5SCZJ9+uRsddC8KKlhnegeY48iYob2QBtsVOoBLXzOhqVZfGs5Hweix98ifOPom8NLy7oyyUgw5V+FBXTgBnEWK9jWCdeC02KOqzPTZRLWcYdqubshl7Etg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IpEpwJ2LPFiH6Cpy4bP461NU/RdCJKr101HcmbE12iY=; b=e11H0uLQzcrzRcekBbyUGjqmeqOD03mRcYilhDPE8eB2eElmvnKVKLKR/WuYU9zye2opUwHiB7Ev9omRaGFKnsGwLeeQwPdBMUgO9OqUhC0npNfBxxWdQ5EPQ7b9tyqcEhh5F+l+O5Xr7uIowb0NOXKljdGA1cxwUfZAOsMaUDd0ktx+iCLHnzLAIz0L9EqOMS2M/JB8OwvsfVXAjoevuZogDNouGtBd36cx5M+LjThXSd5sD5snUwyrtebrrQ8kqUkjqj3rUjIQWJzGvT/4ZTv4dEdz7GmKm54g9vKUoaqzBK092A8PVR1sbo1k0eiKQ+ZDn2krPVB3AikbdhPuVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IpEpwJ2LPFiH6Cpy4bP461NU/RdCJKr101HcmbE12iY=; b=Ltpftq4Wbp2p0VurukbbhWHK72D2ktQOUx6W747exSNTxKwvYjm6BVKUPQGoyfAtnhtl4+eXmy07kKjyrZi7F5f9uzLrqkfis39q9H4M23Lh0v8EXAAsRv2V/ggu7VcjvuYV+4eoacTQKQIDQEFeAt9pHYXBXT3lxl2TXcTexQE= Received: from DM5PR11MB1594.namprd11.prod.outlook.com (2603:10b6:4:5::16) by DM6PR11MB4706.namprd11.prod.outlook.com (2603:10b6:5:2a5::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.14; Thu, 24 Sep 2020 05:19:33 +0000 Received: from DM5PR11MB1594.namprd11.prod.outlook.com ([fe80::952e:51d:d3db:b10a]) by DM5PR11MB1594.namprd11.prod.outlook.com ([fe80::952e:51d:d3db:b10a%12]) with mapi id 15.20.3412.020; Thu, 24 Sep 2020 05:19:33 +0000 From: "Yuwei Chen" To: "Feng, Bob C" , "devel@edk2.groups.io" CC: Liming Gao Subject: Re: [Patch] BaseTools: Set section alignment as zero if its type is Auto Thread-Topic: [Patch] BaseTools: Set section alignment as zero if its type is Auto Thread-Index: AQHWkNNvsFgNXfkaL0GX0nV4eGuto6l3Qq0g Date: Thu, 24 Sep 2020 05:19:33 +0000 Message-ID: References: <20200922112754.36396-1-bob.c.feng@intel.com> In-Reply-To: <20200922112754.36396-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cdaff49f-e9f4-40fa-5d02-08d860496c0d x-ms-traffictypediagnostic: DM6PR11MB4706: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kp86coReZ5XbF9GdJw65nGOiAQ9v8+i7XaJrDawhAcPZ4/McecFHN5o0JM6c6wlD6omccWN0K94017MTt2w33H4jXl3STF4StSmvSm4EjhMG2ep7XNGUIGockiry4iVBRercACrN2h1FOzX1MaI0MJLg2ow8HbycZO6Nj6PD17ncpOAFlX5bi/dO43ktndoOTfoWg+RkRNeAqOKo9xx5kZvgaxsZEc3q/FQPWHnZ8I/YNgRUaHxe+AVUH1bq9NCrKNpL6Mj8XeTVatA0E0s0tTRQJA0V2lQLoB2Z/tDZEGqq74NiqSizqzn6iZ7glnTRwpMA2NO0gPGgB0qJxCrDUu0bU4W2usgErDXkydMKtf7GVo9nGLhKVE6MKePYarhUcGAoh2QYq6E8Pp7ifUfyIIAG1vYnb/AcewlyusUCxlskaUSu9y8mfZVtLug998WJGK0/DtJXJhcyPtdEeJK5Dg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR11MB1594.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(9686003)(33656002)(316002)(110136005)(4326008)(55016002)(7696005)(8936002)(83380400001)(53546011)(6506007)(86362001)(966005)(76116006)(66946007)(52536014)(71200400001)(2906002)(66556008)(8676002)(64756008)(66446008)(478600001)(66476007)(26005)(5660300002)(186003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: AxrZNI5GXeUvnaa1FxTnKqn2RnCsGwa/vBkrz6M3l6kRbpB3Qs16FmommNHAKQhNlMuGqapetdrsRzmwHt0N2ahQcKBuogQFh3tgAcTmYvhqu8VjeGyk6E/l9qXNvchxmfqlpEu42AGB3bdZW+HIGYYMGqnBOs6m2WndwIexOtbBTIQ6eRoNhrXWlmLhP4QpDivXudNbuSWF+vO1oP2U2w/n7FPhrZFoFVo6fF9c3Wehgvbfw7HMadbgB4umXzM9y9Cvg2XtfvAQEk40GwsorBJBHSnbtbbpJdotwjxapnifertwHUzloy/tev1g8u9OXV10zRZwQBroFEhAcho8dMHulfijDuGHqM1kNhdhptY4rfmEO0HrqF8NSyNmWEDOzxDW8riIIyauKJyyOChQP0QuztczjyPKMjfsQTujv78V11EutS7WSJqdgw13eFmgzj2zf+CWLWsyhDCYYAwhMH0srXVQp/CEpwbVFhPTqjKiNamMEYW7jz+F9KnthDv17AdVUvaLCtdd/Nv7jp54ETNJvvPJvGfQKLHYkv0QqA8qtLfkFtQRAjVzu7GmWafmP/1ECH2IS7BcTeIzNj9qdnyJYmB/2D9tuM1u90zk1KIQXTJ8v0Cqf9TX0pbveCX3sjvmM8MXvTzdZZKR4mIxuw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR11MB1594.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdaff49f-e9f4-40fa-5d02-08d860496c0d X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2020 05:19:33.2540 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: q/6F/QnJKStuKLfO+RiFtn2GIDYFVL0c8xfcQP4J98Yuutgw6m2SU8BO6mHslj+lMvQxDSSnhsLWjvUKXaCmIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4706 Return-Path: yuwei.chen@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yuwei Chen > -----Original Message----- > From: Feng, Bob C > Sent: Tuesday, September 22, 2020 7:28 PM > To: devel@edk2.groups.io > Cc: Liming Gao ; Chen, Christine > > Subject: [Patch] BaseTools: Set section alignment as zero if its type is = Auto >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2881 >=20 > 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 t= he > incremental build. >=20 > 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 th= e > incremental build. >=20 > Signed-off-by: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > --- > BaseTools/Source/Python/GenFds/DataSection.py | 9 +-------- > BaseTools/Source/Python/GenFds/EfiSection.py | 9 +-------- > 2 files changed, 2 insertions(+), 16 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/GenFds/DataSection.py > b/BaseTools/Source/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.getmt= ime(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= _TYPE_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 // 0x4= 00) + 'K' > - else: > - self.Alignment =3D str (ImageObj.SectionAlignment // 0x1= 00000) + '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/Source/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 // = 0x400) + 'K' > - else: > - Align =3D str (ImageObj.SectionAlignment // = 0x100000) + 'M' > - > + Align =3D "0" > if File[(len(File)-4):] =3D=3D '.efi' and FfsInf.Inf= Module.BaseName =3D=3D > os.path.basename(File)[:-4]: > MapFile =3D File.replace('.efi', '.map') > CopyMapFile =3D os.path.join(OutputPath, ModuleN= ame + '.map') > if IsMakefile: > if GenFdsGlobalVariable.CopyList =3D=3D []: > -- > 2.20.1.windows.1