From c3b3ef8b78cb2805b24f880ea7d9bc836d08caf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20Ha=CC=88user?= <8659494+mhaeuser@users.noreply.github.com> Date: Tue, 21 Mar 2023 20:02:55 +0100 Subject: [PATCH] BaseTools/GenFv: Remove .text and .data from FV map --- BaseTools/Source/C/GenFv/GenFvInternalLib.c | 27 +-------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c index c16498bf7f..af87d6fa23 100644 --- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c +++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c @@ -755,14 +755,10 @@ Returns: EFI_PHYSICAL_ADDRESS FunctionAddress; UINT32 FunctionType; CHAR8 FunctionTypeName [MAX_LINE_LEN]; - UINT32 Index; UINT32 AddressOfEntryPoint; UINT32 Offset; EFI_IMAGE_OPTIONAL_HEADER_UNION *ImgHdr; - EFI_IMAGE_SECTION_HEADER *SectionHeader; long long TempLongAddress; - UINT32 TextVirtualAddress; - UINT32 DataVirtualAddress; EFI_PHYSICAL_ADDRESS LinkTimeBaseAddress; BOOLEAN IsUseClang; @@ -834,13 +830,6 @@ Returns: ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *) ((UINT8 *) pImageContext->Handle + pImageContext->PeCoffHeaderOffset); AddressOfEntryPoint = ImgHdr->Pe32.OptionalHeader.AddressOfEntryPoint; Offset = 0; - SectionHeader = (EFI_IMAGE_SECTION_HEADER *) ( - (UINT8 *) ImgHdr + - sizeof (UINT32) + - sizeof (EFI_IMAGE_FILE_HEADER) + - ImgHdr->Pe32.FileHeader.SizeOfOptionalHeader - ); - Index = ImgHdr->Pe32.FileHeader.NumberOfSections; // // module information output @@ -857,21 +846,7 @@ Returns: fprintf (FvMapFile, "Type=PE"); fprintf (FvMapFile, ")\n"); - fprintf (FvMapFile, "(GUID=%s", FileGuidName); - TextVirtualAddress = 0; - DataVirtualAddress = 0; - for (; Index > 0; Index --, SectionHeader ++) { - if (stricmp ((CHAR8 *)SectionHeader->Name, ".text") == 0) { - TextVirtualAddress = SectionHeader->VirtualAddress; - } else if (stricmp ((CHAR8 *)SectionHeader->Name, ".data") == 0) { - DataVirtualAddress = SectionHeader->VirtualAddress; - } else if (stricmp ((CHAR8 *)SectionHeader->Name, ".sdata") == 0) { - DataVirtualAddress = SectionHeader->VirtualAddress; - } - } - fprintf (FvMapFile, " .textbaseaddress=0x%010llx", (unsigned long long) (ImageBaseAddress + TextVirtualAddress)); - fprintf (FvMapFile, " .databaseaddress=0x%010llx", (unsigned long long) (ImageBaseAddress + DataVirtualAddress)); - fprintf (FvMapFile, ")\n\n"); + fprintf (FvMapFile, "(GUID=%s)\n\n", FileGuidName); // // Open PeMapFile