diff options
author | Feng, YunhuaX </o=Intel/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Feng, YunhuaX4e1> | 2018-02-06 15:25:53 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-02-07 14:48:04 +0800 |
commit | 4f735fc8cdd9a7e385d285c771abddfcae8a5e58 (patch) | |
tree | 4c912e0eebe4113ef9d3ee21c00b6ddec9e0551a | |
parent | 0a4c903c5a07a5f0b2d2e9e9ba6929ae6a9dddaa (diff) | |
download | edk2-4f735fc8cdd9a7e385d285c771abddfcae8a5e58.tar.gz edk2-4f735fc8cdd9a7e385d285c771abddfcae8a5e58.tar.bz2 edk2-4f735fc8cdd9a7e385d285c771abddfcae8a5e58.zip |
BaseTools: Fix COMPRESS alignment incorrect issue
Doesn't generate the correct alignment for the leaf section
in the compression section.
Below FFS rule doesn't work as the expectation.
[Rule.Common.PEIM.PE32]
FILE PEIM = $(NAMED_GUID) {
PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
COMPRESS {
PE32 PE32 Align=Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
UI STRING="$(MODULE_NAME)" Optional
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
}
}
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
-rw-r--r-- | BaseTools/Source/Python/GenFds/CompressSection.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/GenFds/CompressSection.py b/BaseTools/Source/Python/GenFds/CompressSection.py index 64ad275d83..98532ed8e6 100644 --- a/BaseTools/Source/Python/GenFds/CompressSection.py +++ b/BaseTools/Source/Python/GenFds/CompressSection.py @@ -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, 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,)
+ 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 + \
|