<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">- Bret</p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Ard Biesheuvel via groups.io <ard.biesheuvel=arm.com@groups.io><br>
<b>Sent:</b> Thursday, April 9, 2020 9:09:47 AM<br>
<b>To:</b> devel@edk2.groups.io <devel@edk2.groups.io><br>
<b>Cc:</b> jian.j.wang@intel.com <jian.j.wang@intel.com>; hao.a.wu@intel.com <hao.a.wu@intel.com>; Ard Biesheuvel <ard.biesheuvel@arm.com><br>
<b>Subject:</b> [EXTERNAL] [edk2-devel] [PATCH 1/2] MdeModulePkg/DxeCore/Image: make local functions STATIC</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Use static linkage for functions that are only used locally, to help<br>
the compiler optimize away unused code in non-LTO builds.<br>
<br>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com><br>
---<br>
MdeModulePkg/Core/Dxe/Image/Image.c | 10 ++++++++++<br>
1 file changed, 10 insertions(+)<br>
<br>
diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c<br>
index d86da89ee704..aae2c1eaa516 100644<br>
--- a/MdeModulePkg/Core/Dxe/Image/Image.c<br>
+++ b/MdeModulePkg/Core/Dxe/Image/Image.c<br>
@@ -86,6 +86,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED MACHINE_TYPE_INFO mMachineTypeInfo[] = {<br>
<br>
UINT16 mDxeCoreImageMachineType = 0;<br>
<br>
+#ifndef MDEPKG_NDEBUG<br>
/**<br>
Return machine type name.<br>
<br>
@@ -93,6 +94,7 @@ UINT16 mDxeCoreImageMachineType = 0;<br>
<br>
@return machine type name<br>
**/<br>
+STATIC<br>
CHAR16 *<br>
GetMachineTypeName (<br>
UINT16 MachineType<br>
@@ -108,6 +110,7 @@ GetMachineTypeName (<br>
<br>
return L"<Unknown>";<br>
}<br>
+#endif<br>
<br>
/**<br>
Notification event handler registered by CoreInitializeImageServices () to<br>
@@ -286,6 +289,7 @@ CoreInitializeImageServices (<br>
into buffer.<br>
<br>
**/<br>
+STATIC<br>
EFI_STATUS<br>
EFIAPI<br>
CoreReadImageFile (<br>
@@ -334,6 +338,7 @@ CoreReadImageFile (<br>
@retval EFI_SUCCESS The memory range the image will be loaded in is available<br>
@retval EFI_NOT_FOUND The memory range the image will be loaded in is not available<br>
**/<br>
+STATIC<br>
EFI_STATUS<br>
CheckAndMarkFixLoadingMemoryUsageBitMap (<br>
IN EFI_PHYSICAL_ADDRESS ImageBase,<br>
@@ -407,6 +412,7 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (<br>
@retval EFI_NOT_FOUND The image has no assigned fixed loading address.<br>
<br>
**/<br>
+STATIC<br>
EFI_STATUS<br>
GetPeCoffImageFixLoadingAssignedAddress(<br>
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext<br>
@@ -552,6 +558,7 @@ CoreIsImageTypeSupported (<br>
@retval EFI_BUFFER_TOO_SMALL Buffer for image is too small<br>
<br>
**/<br>
+STATIC<br>
EFI_STATUS<br>
CoreLoadPeImage (<br>
IN BOOLEAN BootPolicy,<br>
@@ -877,6 +884,7 @@ CoreLoadPeImage (<br>
@return Return the image private data associated with ImageHandle.<br>
<br>
**/<br>
+STATIC<br>
LOADED_IMAGE_PRIVATE_DATA *<br>
CoreLoadedImageInfo (<br>
IN EFI_HANDLE ImageHandle<br>
@@ -909,6 +917,7 @@ CoreLoadedImageInfo (<br>
@param FreePage Free allocated pages<br>
<br>
**/<br>
+STATIC<br>
VOID<br>
CoreUnloadAndCloseImage (<br>
IN LOADED_IMAGE_PRIVATE_DATA *Image,<br>
@@ -1105,6 +1114,7 @@ CoreUnloadAndCloseImage (<br>
platform policy specifies that the image should not be started.<br>
<br>
**/<br>
+STATIC<br>
EFI_STATUS<br>
CoreLoadImageCommon (<br>
IN BOOLEAN BootPolicy,<br>
-- <br>
2.17.1<br>
<br>
<br>
<br>
<br>
</div>
</span></font></div>
</body>
</html>
<div width="1" style="color:white;clear:both">_._,_._,_</div>
<hr>
Groups.io Links:<p>
You receive all messages sent to this group.
<p>
<a target="_blank" href="https://edk2.groups.io/g/devel/message/57138">View/Reply Online (#57138)</a> |
|
<a target="_blank" href="https://groups.io/mt/72904810/1813853">Mute This Topic</a>
| <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>
<br>
<a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> |
<a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |
<a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>
[edk2-devel-archive@redhat.com]<br>
<div width="1" style="color:white;clear:both">_._,_._,_</div>