- if os.path.exists(MapFile):\r
- CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')\r
- if not os.path.exists(CopyMapFile) or \\r
- (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
- shutil.copyfile(MapFile, CopyMapFile)\r
+ CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')\r
+ if IsMakefile:\r
+ if GenFdsGlobalVariable.CopyList == []:\r
+ GenFdsGlobalVariable.CopyList = [(MapFile, CopyMapFile)]\r
+ else:\r
+ GenFdsGlobalVariable.CopyList.append((MapFile, CopyMapFile))\r
+ else:\r
+ if os.path.exists(MapFile):\r
+ if not os.path.exists(CopyMapFile) or (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
+ CopyLongFilePath(MapFile, CopyMapFile)\r
+\r
+ #Get PE Section alignment when align is set to AUTO\r
+ if self.Alignment == 'Auto' and self.SecType in (BINARY_FILE_TYPE_TE, BINARY_FILE_TYPE_PE32):\r
+ ImageObj = PeImageClass (Filename)\r
+ if ImageObj.SectionAlignment < 0x400:\r
+ self.Alignment = str (ImageObj.SectionAlignment)\r
+ elif ImageObj.SectionAlignment < 0x100000:\r
+ self.Alignment = str (ImageObj.SectionAlignment / 0x400) + 'K'\r
+ else:\r
+ self.Alignment = str (ImageObj.SectionAlignment / 0x100000) + 'M'\r