X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FDataSection.py;h=a6387b07c582b15fb06496276dca863b1b8d44ea;hb=bfa65b61dde887a9586e070101202bd37e3221fd;hp=99d7392aaab3de984d803b62a8c656aa1544f418;hpb=8bb63e377bf10f5769e1502f8d22579fdd40c701;p=mirror_edk2.git diff --git a/BaseTools/Source/Python/GenFds/DataSection.py b/BaseTools/Source/Python/GenFds/DataSection.py index 99d7392aaa..a6387b07c5 100644 --- a/BaseTools/Source/Python/GenFds/DataSection.py +++ b/BaseTools/Source/Python/GenFds/DataSection.py @@ -15,10 +15,11 @@ ## # Import Modules # -import Section -from GenFdsGlobalVariable import GenFdsGlobalVariable +from __future__ import absolute_import +from . import Section +from .GenFdsGlobalVariable import GenFdsGlobalVariable import subprocess -from Ffs import Ffs +from .Ffs import Ffs import Common.LongFilePathOs as os from CommonDataClass.FdfClass import DataSectionClassObject from Common.Misc import PeImageClass @@ -82,7 +83,7 @@ class DataSection (DataSectionClassObject): CopyLongFilePath(MapFile, CopyMapFile) #Get PE Section alignment when align is set to AUTO - if self.Alignment == 'Auto' and self.SecType in ('TE', 'PE32'): + if self.Alignment == 'Auto' and self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32): ImageObj = PeImageClass (Filename) if ImageObj.SectionAlignment < 0x400: self.Alignment = str (ImageObj.SectionAlignment) @@ -92,7 +93,7 @@ class DataSection (DataSectionClassObject): self.Alignment = str (ImageObj.SectionAlignment / 0x100000) + 'M' NoStrip = True - if self.SecType in ('TE', 'PE32'): + if self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32): if self.KeepReloc is not None: NoStrip = self.KeepReloc @@ -110,7 +111,7 @@ class DataSection (DataSectionClassObject): ) self.SectFileName = StrippedFile - if self.SecType == 'TE': + if self.SecType == BINARY_FILE_TYPE_TE: TeFile = os.path.join( OutputPath, ModuleName + 'Te.raw') GenFdsGlobalVariable.GenerateFirmwareImage( TeFile,