]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/EfiSection.py
BaseTools: cache the defined Guid tool to improve the performance
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / EfiSection.py
index 15ebac5705d6b0bf20750cba71168e8f6d88686e..09fb28f32d78c227895af41176c2594e1b6a8c27 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process rule section generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -97,6 +97,7 @@ class EfiSection (EfiSectionClassObject):
                 return FileList, self.Alignment\r
 \r
         Index = 0\r
+        Align = self.Alignment\r
 \r
         """ If Section type is 'VERSION'"""\r
         OutputFileList = []\r
@@ -211,10 +212,10 @@ class EfiSection (EfiSectionClassObject):
             """If File List is empty"""\r
             if FileList == [] :\r
                 if self.Optional == True:\r
-                     GenFdsGlobalVariable.VerboseLogger( "Optional Section don't exist!")\r
-                     return [], None\r
+                    GenFdsGlobalVariable.VerboseLogger("Optional Section don't exist!")\r
+                    return [], None\r
                 else:\r
-                     EdkLogger.error("GenFds", GENFDS_ERROR, "Output file for %s section could not be found for %s" % (SectionType, InfFileName))\r
+                    EdkLogger.error("GenFds", GENFDS_ERROR, "Output file for %s section could not be found for %s" % (SectionType, InfFileName))\r
 \r
             else:\r
                 """Convert the File to Section file one by one """\r
@@ -229,9 +230,9 @@ class EfiSection (EfiSectionClassObject):
                     if self.Alignment == 'Auto' and (SectionType == 'PE32' or SectionType == 'TE'):\r
                         ImageObj = PeImageClass (File)\r
                         if ImageObj.SectionAlignment < 0x400:\r
-                            self.Alignment = str (ImageObj.SectionAlignment)\r
+                            Align = str (ImageObj.SectionAlignment)\r
                         else:\r
-                            self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K'\r
+                            Align = str (ImageObj.SectionAlignment / 0x400) + 'K'\r
 \r
                     if File[(len(File)-4):] == '.efi':\r
                         MapFile = File.replace('.efi', '.map')\r
@@ -272,4 +273,4 @@ class EfiSection (EfiSectionClassObject):
                                                          )\r
                     OutputFileList.append(OutputFile)\r
 \r
-        return OutputFileList, self.Alignment\r
+        return OutputFileList, Align\r