X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FGenFds%2FCompressSection.py;h=98532ed8e698d769106d8a57de24fa9f57585f8f;hb=4f735fc8cdd9a7e385d285c771abddfcae8a5e58;hp=fac58d14f82b0fc58e1aa6bb77f699acd43c5128;hpb=97fa0ee9b1cffbb4b97ee35365afa7afcf50e174;p=mirror_edk2.git
diff --git a/BaseTools/Source/Python/GenFds/CompressSection.py b/BaseTools/Source/Python/GenFds/CompressSection.py
index fac58d14f8..98532ed8e6 100644
--- a/BaseTools/Source/Python/GenFds/CompressSection.py
+++ b/BaseTools/Source/Python/GenFds/CompressSection.py
@@ -1,7 +1,7 @@
## @file
# process compress section generation
#
-# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -53,7 +53,7 @@ class CompressSection (CompressSectionClassObject) :
# @param Dict dictionary contains macro and its value
# @retval tuple (Generated file name, section alignment)
#
- def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}):
+ def GenSection(self, OutputPath, ModuleName, SecNum, KeyStringList, FfsInf = None, Dict = {}, IsMakefile = False):
if FfsInf != None:
self.CompType = FfsInf.__ExtendMacro__(self.CompType)
@@ -61,14 +61,28 @@ class CompressSection (CompressSectionClassObject) :
SectFiles = tuple()
Index = 0
+ MaxAlign = None
for Sect in self.SectionList:
Index = Index + 1
SecIndex = '%s.%d' %(SecNum, Index)
- ReturnSectList, AlignValue = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, Dict)
+ ReturnSectList, AlignValue = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=IsMakefile)
+ if AlignValue != None:
+ if MaxAlign == None:
+ MaxAlign = AlignValue
+ if GenFdsGlobalVariable.GetAlignment (AlignValue) > GenFdsGlobalVariable.GetAlignment (MaxAlign):
+ MaxAlign = AlignValue
if ReturnSectList != []:
+ if AlignValue == None:
+ AlignValue = "1"
for FileData in ReturnSectList:
- SectFiles += (FileData,)
+ SectFiles += (FileData,)
+ if MaxAlign != None:
+ if self.Alignment == None:
+ self.Alignment = MaxAlign
+ else:
+ if GenFdsGlobalVariable.GetAlignment (MaxAlign) > GenFdsGlobalVariable.GetAlignment (self.Alignment):
+ self.Alignment = MaxAlign
OutputFile = OutputPath + \
os.sep + \
@@ -79,7 +93,7 @@ class CompressSection (CompressSectionClassObject) :
OutputFile = os.path.normpath(OutputFile)
GenFdsGlobalVariable.GenerateSection(OutputFile, SectFiles, Section.Section.SectionType['COMPRESS'],
- CompressionType=self.CompTypeDict[self.CompType])
+ CompressionType=self.CompTypeDict[self.CompType], IsMakefile=IsMakefile)
OutputFileList = []
OutputFileList.append(OutputFile)
return OutputFileList, self.Alignment