mirror of https://github.com/acidanthera/audk.git
BaseTools: Set section alignment as zero if its type is Auto
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2881 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 <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>
This commit is contained in:
parent
3a7a676114
commit
d8be01079b
|
@ -80,14 +80,7 @@ class DataSection (DataSectionClassObject):
|
||||||
|
|
||||||
#Get PE Section alignment when align is set to AUTO
|
#Get PE Section alignment when align is set to AUTO
|
||||||
if self.Alignment == 'Auto' and self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):
|
if self.Alignment == 'Auto' and self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):
|
||||||
ImageObj = PeImageClass (Filename)
|
self.Alignment = "0"
|
||||||
if ImageObj.SectionAlignment < 0x400:
|
|
||||||
self.Alignment = str (ImageObj.SectionAlignment)
|
|
||||||
elif ImageObj.SectionAlignment < 0x100000:
|
|
||||||
self.Alignment = str (ImageObj.SectionAlignment // 0x400) + 'K'
|
|
||||||
else:
|
|
||||||
self.Alignment = str (ImageObj.SectionAlignment // 0x100000) + 'M'
|
|
||||||
|
|
||||||
NoStrip = True
|
NoStrip = True
|
||||||
if self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):
|
if self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):
|
||||||
if self.KeepReloc is not None:
|
if self.KeepReloc is not None:
|
||||||
|
|
|
@ -260,14 +260,7 @@ class EfiSection (EfiSectionClassObject):
|
||||||
|
|
||||||
#Get PE Section alignment when align is set to AUTO
|
#Get PE Section alignment when align is set to AUTO
|
||||||
if self.Alignment == 'Auto' and (SectionType == BINARY_FILE_TYPE_PE32 or SectionType == BINARY_FILE_TYPE_TE):
|
if self.Alignment == 'Auto' and (SectionType == BINARY_FILE_TYPE_PE32 or SectionType == BINARY_FILE_TYPE_TE):
|
||||||
ImageObj = PeImageClass (File)
|
Align = "0"
|
||||||
if ImageObj.SectionAlignment < 0x400:
|
|
||||||
Align = str (ImageObj.SectionAlignment)
|
|
||||||
elif ImageObj.SectionAlignment < 0x100000:
|
|
||||||
Align = str (ImageObj.SectionAlignment // 0x400) + 'K'
|
|
||||||
else:
|
|
||||||
Align = str (ImageObj.SectionAlignment // 0x100000) + 'M'
|
|
||||||
|
|
||||||
if File[(len(File)-4):] == '.efi' and FfsInf.InfModule.BaseName == os.path.basename(File)[:-4]:
|
if File[(len(File)-4):] == '.efi' and FfsInf.InfModule.BaseName == os.path.basename(File)[:-4]:
|
||||||
MapFile = File.replace('.efi', '.map')
|
MapFile = File.replace('.efi', '.map')
|
||||||
CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')
|
CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')
|
||||||
|
|
Loading…
Reference in New Issue