From cfaaf99bdd412139ca7b9724e678429b2f2fb45f Mon Sep 17 00:00:00 2001 From: Yonghong Zhu Date: Fri, 1 Apr 2016 15:20:51 +0800 Subject: BaseTools/GenFds: Fix the bug for wrong alignment generate for RAW file When do the multiple raw file support feature, it cause the regression that the raw file section alignment value was wrongly overridden by the single raw file. this patch: 1) fix the wrong overridden bug. 2) remove the duplicate code for combine multiple raw file into one. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/GenFds/FdfParser.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'BaseTools/Source/Python/GenFds/FdfParser.py') diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 12d4f2bb73..28af09b982 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -2716,14 +2716,13 @@ class FdfParser: # def __GetRAWData(self, FfsFileObj, MacroDict = {}): FfsFileObj.FileName = [] - FfsFileObj.Alignment = [] - AlignDict = {"Auto":1, "8":8, "16":16, "32":32, "64":64, "128":128, "512":512, "1K":1024, "4K":4096, "32K":32768, "64K":65536} + FfsFileObj.SubAlignment = [] while True: AlignValue = None if self.__GetAlignment(): if self.__Token not in ("Auto", "8", "16", "32", "64", "128", "512", "1K", "4K", "32K" ,"64K"): raise Warning("Incorrect alignment '%s'" % self.__Token, self.FileName, self.CurrentLineNumber) - AlignValue = AlignValue = AlignDict[self.__Token] + AlignValue = self.__Token if not self.__GetNextToken(): raise Warning("expected Filename value", self.FileName, self.CurrentLineNumber) @@ -2735,14 +2734,14 @@ class FdfParser: self.__VerifyFile(FileName) File = PathClass(NormPath(FileName), GenFdsGlobalVariable.WorkSpaceDir) FfsFileObj.FileName.append(File.Path) - FfsFileObj.Alignment.append(AlignValue) + FfsFileObj.SubAlignment.append(AlignValue) if self.__IsToken( "}"): self.__UndoToken() break - if len(FfsFileObj.Alignment) == 1: - FfsFileObj.Alignment = FfsFileObj.Alignment[0] + if len(FfsFileObj.SubAlignment) == 1: + FfsFileObj.SubAlignment = FfsFileObj.SubAlignment[0] if len(FfsFileObj.FileName) == 1: FfsFileObj.FileName = FfsFileObj.FileName[0] -- cgit v1.2.3