From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web08.8571.1604909323935394020 for ; Mon, 09 Nov 2020 00:08:44 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: fengyunhua@byosoft.com.cn) Received: from localhost.localdomain ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 09 Nov 2020 16:08:42 +0800 X-WM-Sender: fengyunhua@byosoft.com.cn From: "fengyunhua" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao , Yuwei Chen Subject: [PATCH v3 1/2] BaseTools: Add image type into generate map file Date: Mon, 9 Nov 2020 16:08:01 +0800 Message-Id: <20201109080802.2217-2-fengyunhua@byosoft.com.cn> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20201109080802.2217-1-fengyunhua@byosoft.com.cn> References: <20201109080802.2217-1-fengyunhua@byosoft.com.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2977 For a source-level BIOS debugger the .map files are quite useful with one major shortcoming: the debugger cannot know, solely from the .map file, the format (PE/COFF vs. TE) of the image included in the final BIOS ROM Add Type=PE or TE in the map file Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Yunhua Feng --- BaseTools/Source/C/GenFv/GenFvInternalLib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c index b5ffed93a9..6e296b8ad6 100644 --- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c +++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c @@ -903,7 +903,12 @@ Returns: fprintf (FvMapFile, "BaseAddress=0x%010llx, ", (unsigned long long) (ImageBaseAddress + Offset)); } - fprintf (FvMapFile, "EntryPoint=0x%010llx", (unsigned long long) (ImageBaseAddress + AddressOfEntryPoint)); + fprintf (FvMapFile, "EntryPoint=0x%010llx, ", (unsigned long long) (ImageBaseAddress + AddressOfEntryPoint)); + if (!pImageContext->IsTeImage) { + fprintf (FvMapFile, "Type=PE"); + } else { + fprintf (FvMapFile, "Type=TE"); + } fprintf (FvMapFile, ")\n"); fprintf (FvMapFile, "(GUID=%s", FileGuidName); -- 2.27.0.windows.1