From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.7842.1600916643825428716 for ; Wed, 23 Sep 2020 20:04:04 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Thu, 24 Sep 2020 11:03:58 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Yuwei Chen'" References: <20200922112754.36396-1-bob.c.feng@intel.com> In-Reply-To: <20200922112754.36396-1-bob.c.feng@intel.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BhdGNoXSBCYXNlVG9vbHM6IFNldCBzZWN0aW9uIGFsaWdubWVudCBhcyB6ZXJvIGlmIGl0cyB0eXBlIGlzIEF1dG8=?= Date: Thu, 24 Sep 2020 11:04:01 +0800 Message-ID: <005501d6921f$5a9cb830$0fd62890$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGpm5DRxnv32205ejC5WChHBNPGIanRB4/Q Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Reviewed-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: bounce+27952+65441+4905953+8761045@groups.io > =B4=FA=B1=ED Bob Feng > =B7=A2=CB=CD=CA=B1=BC=E4: 2020=C4=EA9=D4=C222=C8=D5 19:28 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Liming Gao ; Yuwei Chen > > =D6=F7=CC=E2: [edk2-devel] [Patch] BaseTools: Set section alignment as z= ero 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 the 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 the 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.getmtime(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 // > 0x400) + 'K' > - else: > - self.Alignment =3D str (ImageObj.SectionAlignment // > 0x100000) + '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.InfModule.BaseName =3D=3D os.path.basename(File)[:-4]: > MapFile =3D File.replace('.efi', '.map') > CopyMapFile =3D os.path.join(OutputPath, > ModuleName + '.map') > if IsMakefile: > if GenFdsGlobalVariable.CopyList =3D=3D []: > -- > 2.20.1.windows.1 >=20 >=20 >=20 >=20 >=20