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>
\r
SectFiles = tuple()\r
Index = 0\r
\r
SectFiles = tuple()\r
Index = 0\r
for Sect in self.SectionList:\r
Index = Index + 1\r
SecIndex = '%s.%d' %(SecNum, Index)\r
ReturnSectList, AlignValue = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=IsMakefile)\r
for Sect in self.SectionList:\r
Index = Index + 1\r
SecIndex = '%s.%d' %(SecNum, Index)\r
ReturnSectList, AlignValue = Sect.GenSection(OutputPath, ModuleName, SecIndex, KeyStringList, FfsInf, Dict, IsMakefile=IsMakefile)\r
+ if AlignValue != None:\r
+ if MaxAlign == None:\r
+ MaxAlign = AlignValue\r
+ if GenFdsGlobalVariable.GetAlignment (AlignValue) > GenFdsGlobalVariable.GetAlignment (MaxAlign):\r
+ MaxAlign = AlignValue\r
if ReturnSectList != []:\r
if ReturnSectList != []:\r
+ if AlignValue == None:\r
+ AlignValue = "1"\r
for FileData in ReturnSectList:\r
SectFiles += (FileData,)\r
\r
for FileData in ReturnSectList:\r
SectFiles += (FileData,)\r
\r
+ if MaxAlign != None:\r
+ if self.Alignment == None:\r
+ self.Alignment = MaxAlign\r
+ else:\r
+ if GenFdsGlobalVariable.GetAlignment (MaxAlign) > GenFdsGlobalVariable.GetAlignment (self.Alignment):\r
+ self.Alignment = MaxAlign\r
\r
OutputFile = OutputPath + \\r
os.sep + \\r
\r
OutputFile = OutputPath + \\r
os.sep + \\r