[EXTERNAL] [edk2-devel] [PATCH 1/2] MdeModulePkg/DxeCore/Image: make local functions STATIC
Bret Barkelew via groups.io
bret.barkelew=microsoft.com at groups.io
Thu Apr 9 19:13:06 UTC 2020
Reviewed-by: Bret Barkelew <bret.barkelew at microsoft.com>
- Bret
________________________________
From: devel at edk2.groups.io <devel at edk2.groups.io> on behalf of Ard Biesheuvel via groups.io <ard.biesheuvel=arm.com at groups.io>
Sent: Thursday, April 9, 2020 9:09:47 AM
To: devel at edk2.groups.io <devel at edk2.groups.io>
Cc: jian.j.wang at intel.com <jian.j.wang at intel.com>; hao.a.wu at intel.com <hao.a.wu at intel.com>; Ard Biesheuvel <ard.biesheuvel at arm.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH 1/2] MdeModulePkg/DxeCore/Image: make local functions STATIC
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 <ard.biesheuvel at arm.com>
---
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"<Unknown>";
}
+#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
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#57138): https://edk2.groups.io/g/devel/message/57138
Mute This Topic: https://groups.io/mt/72904810/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20200409/d205a2fb/attachment.htm>
More information about the edk2-devel-archive
mailing list