From c5e36c7b7e1098c906f0ce6fda67c9fc27c7d668 Mon Sep 17 00:00:00 2001 From: Marvin <8659494+mhaeuser@users.noreply.github.com> Date: Wed, 14 Jun 2023 16:15:42 +0200 Subject: [PATCH] ImageTool: Remove unused code --- BaseTools/ImageTool/PeScan.c | 69 ------------------------------------ 1 file changed, 69 deletions(-) diff --git a/BaseTools/ImageTool/PeScan.c b/BaseTools/ImageTool/PeScan.c index b73e9d5804..536450bf67 100644 --- a/BaseTools/ImageTool/PeScan.c +++ b/BaseTools/ImageTool/PeScan.c @@ -234,72 +234,3 @@ ScanPeGetSegmentInfo ( return RETURN_SUCCESS; } - -bool -ScanPeGetDebugInfo ( - OUT image_tool_debug_info_t *DebugInfo, - IN PE_COFF_LOADER_IMAGE_CONTEXT *Context - ) -{ - const CHAR8 *PdbPath; - UINT32 PdbPathSize; - RETURN_STATUS Status; - - Status = PeCoffGetPdbPath (Context, &PdbPath, &PdbPathSize); - if (Status == RETURN_NOT_FOUND) { - return true; - } - if (RETURN_ERROR (Status)) { - fprintf (stderr, "ImageTool: Could not get PdbPath\n"); - return false; - } - - DebugInfo->SymbolsPath = malloc (PdbPathSize); - if (DebugInfo->SymbolsPath == NULL) { - fprintf (stderr, "ImageTool: Could not allocate memory for SymbolsPath\n"); - return false; - } - - memmove (DebugInfo->SymbolsPath, PdbPath, PdbPathSize); - - assert (PdbPathSize >= 1); - assert (DebugInfo->SymbolsPath[PdbPathSize - 1] == '\0'); - - DebugInfo->SymbolsPathLen = PdbPathSize - 1; - - return true; -} - -bool -ScanPeGetHiiInfo ( - OUT image_tool_hii_info_t *HiiInfo, - IN PE_COFF_LOADER_IMAGE_CONTEXT *Context - ) -{ - UINT32 HiiRva; - UINT32 HiiSize; - RETURN_STATUS Status; - const char *ImageBuffer; - - Status = PeCoffGetHiiDataRva (Context, &HiiRva, &HiiSize); - if (Status == RETURN_NOT_FOUND) { - return true; - } - if (RETURN_ERROR (Status)) { - fprintf (stderr, "ImageTool: Could not get HiiRva\n"); - return false; - } - - HiiInfo->Data = calloc (1, HiiSize); - if (HiiInfo->Data == NULL) { - fprintf (stderr, "ImageTool: Could not allocate memory for HiiInfo Data\n"); - return false; - } - - ImageBuffer = (char *)PeCoffLoaderGetImageAddress (Context); - - memmove (HiiInfo->Data, ImageBuffer + HiiRva, HiiSize); - HiiInfo->DataSize = HiiSize; - - return true; -}