Create load fix address map when single module build with fds target.
authorlgao4 <lgao4@c2973edb-eda0-4c78-bc6a-9341b269661f>
Tue, 23 Feb 2010 14:16:18 +0000 (14:16 +0000)
committerlgao4 <lgao4@c2973edb-eda0-4c78-bc6a-9341b269661f>
Tue, 23 Feb 2010 14:16:18 +0000 (14:16 +0000)
git-svn-id: https://edk2-buildtools.svn.sourceforge.net/svnroot/edk2-buildtools/trunk/BaseTools@1885 c2973edb-eda0-4c78-bc6a-9341b269661f

Source/Python/build/build.py

index f31026d..b8f51ff 100644 (file)
@@ -1355,6 +1355,42 @@ class Build():
                                     (', '.join(self.ArchList), self.Platform),\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
+                    for Arch in self.ArchList:\r
+                        #\r
+                        # Check whether the set fix address is above 4G for 32bit image.\r
+                        #\r
+                        if (Arch == 'IA32' or Arch == 'ARM') and self.LoadFixAddress != 0xFFFFFFFFFFFFFFFF and self.LoadFixAddress >= 0x100000000:\r
+                            EdkLogger.error("build", PARAMETER_INVALID, "FIX_LOAD_TOP_MEMORY_ADDRESS can't be set to larger than or equal to 4G for the platorm with IA32 or ARM arch modules")\r
+                    #\r
+                    # Get Module List\r
+                    #\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
+\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
+                    #\r
+                    # Create MAP file for all platform FVs after GenFds.\r
+                    #\r
+                    self._CollectFvMapBuffer(MapBuffer, Wa)\r
+                    #\r
+                    # Save MAP buffer into MAP file.\r
+                    #\r
+                    self._SaveMapFile (MapBuffer, Wa)\r
 \r
     ## Build a platform in multi-thread mode\r
     #\r