From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.12473.1586448595090282830 for ; Thu, 09 Apr 2020 09:09:55 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BDF867FA; Thu, 9 Apr 2020 09:09:54 -0700 (PDT) Received: from e123331-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F06263F52E; Thu, 9 Apr 2020 09:09:53 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: jian.j.wang@intel.com, hao.a.wu@intel.com, Ard Biesheuvel Subject: [PATCH 1/2] MdeModulePkg/DxeCore/Image: make local functions STATIC Date: Thu, 9 Apr 2020 18:09:47 +0200 Message-Id: <20200409160948.23427-2-ard.biesheuvel@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200409160948.23427-1-ard.biesheuvel@arm.com> References: <20200409160948.23427-1-ard.biesheuvel@arm.com> Use static linkage for functions that are only used locally, to help the compiler optimize away unused code in non-LTO builds. Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Core/Dxe/Image/Image.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index d86da89ee704..aae2c1eaa516 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -86,6 +86,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED MACHINE_TYPE_INFO mMachineTypeInfo[] = { UINT16 mDxeCoreImageMachineType = 0; +#ifndef MDEPKG_NDEBUG /** Return machine type name. @@ -93,6 +94,7 @@ UINT16 mDxeCoreImageMachineType = 0; @return machine type name **/ +STATIC CHAR16 * GetMachineTypeName ( UINT16 MachineType @@ -108,6 +110,7 @@ GetMachineTypeName ( return L""; } +#endif /** Notification event handler registered by CoreInitializeImageServices () to @@ -286,6 +289,7 @@ CoreInitializeImageServices ( into buffer. **/ +STATIC EFI_STATUS EFIAPI CoreReadImageFile ( @@ -334,6 +338,7 @@ CoreReadImageFile ( @retval EFI_SUCCESS The memory range the image will be loaded in is available @retval EFI_NOT_FOUND The memory range the image will be loaded in is not available **/ +STATIC EFI_STATUS CheckAndMarkFixLoadingMemoryUsageBitMap ( IN EFI_PHYSICAL_ADDRESS ImageBase, @@ -407,6 +412,7 @@ CheckAndMarkFixLoadingMemoryUsageBitMap ( @retval EFI_NOT_FOUND The image has no assigned fixed loading address. **/ +STATIC EFI_STATUS GetPeCoffImageFixLoadingAssignedAddress( IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext @@ -552,6 +558,7 @@ CoreIsImageTypeSupported ( @retval EFI_BUFFER_TOO_SMALL Buffer for image is too small **/ +STATIC EFI_STATUS CoreLoadPeImage ( IN BOOLEAN BootPolicy, @@ -877,6 +884,7 @@ CoreLoadPeImage ( @return Return the image private data associated with ImageHandle. **/ +STATIC LOADED_IMAGE_PRIVATE_DATA * CoreLoadedImageInfo ( IN EFI_HANDLE ImageHandle @@ -909,6 +917,7 @@ CoreLoadedImageInfo ( @param FreePage Free allocated pages **/ +STATIC VOID CoreUnloadAndCloseImage ( IN LOADED_IMAGE_PRIVATE_DATA *Image, @@ -1105,6 +1114,7 @@ CoreUnloadAndCloseImage ( platform policy specifies that the image should not be started. **/ +STATIC EFI_STATUS CoreLoadImageCommon ( IN BOOLEAN BootPolicy, -- 2.17.1