\r
## Collect MAP information of all FVs\r
#\r
- def _CollectFvMapBuffer (self, MapBuffer, Wa):\r
+ def _CollectFvMapBuffer (self, MapBuffer, Wa, ModuleList):\r
if self.Fdf != '':\r
# First get the XIP base address for FV map file.\r
+ GuidPattern = re.compile("[-a-fA-F0-9]+")\r
for FvName in Wa.FdfProfile.FvDict.keys():\r
FvMapBuffer = os.path.join(Wa.FvDir, FvName + '.Fv.map')\r
if not os.path.exists(FvMapBuffer):\r
FvMap.readline()\r
FvMap.readline()\r
FvMap.readline()\r
- MapBuffer.write(FvMap.read())\r
+ for Line in FvMap:\r
+ MatchGuid = GuidPattern.match(Line)\r
+ if MatchGuid != None:\r
+ #\r
+ # Replace GUID with module name\r
+ #\r
+ GuidString = MatchGuid.group()\r
+ if GuidString.upper() in ModuleList:\r
+ Line = Line.replace(GuidString, ModuleList[GuidString.upper()].Name)\r
+ MapBuffer.write('%s' % (Line))\r
FvMap.close()\r
\r
## Collect MAP information of all modules\r
IsIpfPlatform = False\r
if 'IPF' in self.ArchList:\r
IsIpfPlatform = True\r
- for Module in ModuleList:\r
+ for ModuleGuid in ModuleList:\r
+ Module = ModuleList[ModuleGuid]\r
GlobalData.gProcessingFile = "%s [%s, %s, %s]" % (Module.MetaFile, Module.Arch, Module.ToolChain, Module.BuildTarget)\r
\r
OutputImageFile = ''\r
#\r
SaveFileOnChange(MapFilePath, MapBuffer.getvalue(), False)\r
MapBuffer.close()\r
- sys.stdout.write ("\nLoad Module At Fix Address Map file saved to %s\n" %(MapFilePath))
+ if self.LoadFixAddress != 0:
+ sys.stdout.write ("\nLoad Module At Fix Address Map file saved to %s\n" %(MapFilePath))
sys.stdout.flush()
\r
## Build active platform for different build targets and different tool chains\r
self._Build(self.Target, Wa)\r
\r
# Create MAP file when Load Fix Address is enabled.\r
- if self.Target in ["", "all", "fds"] and self.LoadFixAddress != 0:\r
+ if self.Target in ["", "all", "fds"]:\r
for Arch in self.ArchList:\r
#\r
# Check whether the set fix address is above 4G for 32bit image.\r
#\r
# Get Module List\r
#\r
- ModuleList = []\r
+ ModuleList = {}\r
for Pa in Wa.AutoGenObjectList:\r
for Ma in Pa.ModuleAutoGenList:\r
if Ma == None:\r
continue\r
if not Ma.IsLibrary:\r
- ModuleList.append (Ma)\r
+ ModuleList[Ma.Guid.upper()] = Ma\r
\r
MapBuffer = StringIO('')\r
- #\r
- # Rebase module to the preferred memory address before GenFds\r
- #\r
- self._CollectModuleMapBuffer(MapBuffer, ModuleList)\r
+ if self.LoadFixAddress != 0:\r
+ #\r
+ # Rebase module to the preferred memory address before GenFds\r
+ #\r
+ self._CollectModuleMapBuffer(MapBuffer, ModuleList)\r
if self.Fdf != '':\r
#\r
# create FDS again for the updated EFI image\r
#\r
# Create MAP file for all platform FVs after GenFds.\r
#\r
- self._CollectFvMapBuffer(MapBuffer, Wa)\r
+ self._CollectFvMapBuffer(MapBuffer, Wa, ModuleList)\r
#\r
# Save MAP buffer into MAP file.\r
#\r
ExtraData=self.ModuleFile\r
)\r
# Create MAP file when Load Fix Address is enabled.\r
- if self.LoadFixAddress != 0 and self.Target == "fds" and self.Fdf != '':\r
+ if self.Target == "fds" and self.Fdf != '':\r
for Arch in self.ArchList:\r
#\r
# Check whether the set fix address is above 4G for 32bit image.\r
#\r
# Get Module List\r
#\r
- ModuleList = []\r
+ ModuleList = {}\r
for Pa in Wa.AutoGenObjectList:\r
for Ma in Pa.ModuleAutoGenList:\r
if Ma == None:\r
continue\r
if not Ma.IsLibrary:\r
- ModuleList.append (Ma)\r
+ ModuleList[Ma.Guid.upper()] = Ma\r
\r
MapBuffer = StringIO('')\r
- #\r
- # Rebase module to the preferred memory address before GenFds\r
- #\r
- self._CollectModuleMapBuffer(MapBuffer, ModuleList)\r
- #\r
- # create FDS again for the updated EFI image\r
- #\r
- self._Build("fds", Wa)\r
+ if self.LoadFixAddress != 0:\r
+ #\r
+ # Rebase module to the preferred memory address before GenFds\r
+ #\r
+ self._CollectModuleMapBuffer(MapBuffer, ModuleList)\r
+ #\r
+ # create FDS again for the updated EFI image\r
+ #\r
+ self._Build("fds", Wa)\r
#\r
# Create MAP file for all platform FVs after GenFds.\r
#\r
- self._CollectFvMapBuffer(MapBuffer, Wa)\r
+ self._CollectFvMapBuffer(MapBuffer, Wa, ModuleList)\r
#\r
# Save MAP buffer into MAP file.\r
#\r
EdkLogger.error("build", BUILD_ERROR, "Failed to build module", ExtraData=GlobalData.gBuildingModule)\r
\r
# Create MAP file when Load Fix Address is enabled.\r
- if self.Target in ["", "all", "fds"] and self.LoadFixAddress != 0:\r
+ if self.Target in ["", "all", "fds"]:\r
for Arch in self.ArchList:\r
#\r
# Check whether the set fix address is above 4G for 32bit image.\r
#\r
# Get Module List\r
#\r
- ModuleList = []\r
+ ModuleList = {}\r
for Pa in Wa.AutoGenObjectList:\r
for Ma in Pa.ModuleAutoGenList:\r
if Ma == None:\r
continue\r
if not Ma.IsLibrary:\r
- ModuleList.append (Ma)\r
+ ModuleList[Ma.Guid.upper()] = Ma\r
#\r
# Rebase module to the preferred memory address before GenFds\r
#\r
MapBuffer = StringIO('')\r
- self._CollectModuleMapBuffer(MapBuffer, ModuleList)\r
+ if self.LoadFixAddress != 0:\r
+ self._CollectModuleMapBuffer(MapBuffer, ModuleList)\r
\r
# Generate FD image if there's a FDF file found\r
if self.Fdf != '' and self.Target in ["", "all", "fds"]:\r
LaunchCommand(Wa.BuildCommand + ["fds"], Wa.MakeFileDir)\r
\r
# Create MAP file for all platform FV after GenFds\r
- if self.Target in ["", "all", "fds"] and self.LoadFixAddress != 0:\r
+ if self.Target in ["", "all", "fds"]:\r
if self.Fdf != '':\r
#\r
# Create MAP file for all platform FVs after GenFds.\r
#\r
- self._CollectFvMapBuffer(MapBuffer, Wa)\r
+ self._CollectFvMapBuffer(MapBuffer, Wa, ModuleList)\r
#\r
# Save MAP buffer into MAP file.\r
#\r