]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/CompressSection.py
BaseTools: Fix COMPRESS alignment incorrect issue
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / CompressSection.py
index 64ad275d832ed0c30eb6d784dad5cc53a60a7ffa..98532ed8e698d769106d8a57de24fa9f57585f8f 100644 (file)
@@ -61,14 +61,28 @@ class CompressSection (CompressSectionClassObject) :
 \r
         SectFiles = tuple()\r
         Index = 0\r
+        MaxAlign = None\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 AlignValue == None:\r
+                    AlignValue = "1"\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