]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BasePeCoffLib / PeCoffLoaderEx.c
CommitLineData
d071fb19 1/** @file\r
2bfb6009 2 Specific relocation fixups for none Itanium architecture.\r
d071fb19 3\r
9095d37b 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
d071fb19 6\r
d071fb19 7**/\r
8\r
f734a10a 9#include "BasePeCoffLibInternals.h"\r
d071fb19 10\r
11\r
d071fb19 12/**\r
efb23117 13 Performs an Itanium-based specific relocation fixup and is a no-op on other\r
14 instruction sets.\r
d071fb19 15\r
2fc59a00 16 @param Reloc The pointer to the relocation record.\r
17 @param Fixup The pointer to the address to fix up.\r
18 @param FixupData The pointer to a buffer to log the fixups.\r
d071fb19 19 @param Adjust The offset to adjust the fixup.\r
20\r
efb23117 21 @return Status code.\r
d071fb19 22\r
23**/\r
24RETURN_STATUS\r
25PeCoffLoaderRelocateImageEx (\r
26 IN UINT16 *Reloc,\r
27 IN OUT CHAR8 *Fixup,\r
28 IN OUT CHAR8 **FixupData,\r
29 IN UINT64 Adjust\r
30 )\r
31{\r
32 return RETURN_UNSUPPORTED;\r
33}\r
34\r
35/**\r
efb23117 36 Returns TRUE if the machine type of PE/COFF image is supported. Supported\r
d071fb19 37 does not mean the image can be executed it means the PE/COFF loader supports\r
38 loading and relocating of the image type. It's up to the caller to support\r
efb23117 39 the entry point.\r
9095d37b 40\r
981b0f90 41 The IA32/X64 version PE/COFF loader/relocater both support IA32, X64 and EBC images.\r
d071fb19 42\r
2fc59a00 43 @param Machine The machine type from the PE Header.\r
d071fb19 44\r
45 @return TRUE if this PE/COFF loader can load the image\r
46\r
47**/\r
48BOOLEAN\r
49PeCoffLoaderImageFormatSupported (\r
50 IN UINT16 Machine\r
51 )\r
52{\r
9095d37b 53 if ((Machine == IMAGE_FILE_MACHINE_I386) || (Machine == IMAGE_FILE_MACHINE_X64) ||\r
7a0ce8c5 54 (Machine == IMAGE_FILE_MACHINE_EBC) || (Machine == IMAGE_FILE_MACHINE_ARM64)) {\r
9095d37b 55 return TRUE;\r
d071fb19 56 }\r
57\r
58 return FALSE;\r
59}\r
60\r
61/**\r
62 Performs an Itanium-based specific re-relocation fixup and is a no-op on other\r
63 instruction sets. This is used to re-relocated the image into the EFI virtual\r
64 space for runtime calls.\r
65\r
2fc59a00 66 @param Reloc The pointer to the relocation record.\r
67 @param Fixup The pointer to the address to fix up.\r
68 @param FixupData The pointer to a buffer to log the fixups.\r
d071fb19 69 @param Adjust The offset to adjust the fixup.\r
70\r
efb23117 71 @return Status code.\r
d071fb19 72\r
73**/\r
74RETURN_STATUS\r
75PeHotRelocateImageEx (\r
76 IN UINT16 *Reloc,\r
77 IN OUT CHAR8 *Fixup,\r
78 IN OUT CHAR8 **FixupData,\r
79 IN UINT64 Adjust\r
80 )\r
81{\r
82 return RETURN_UNSUPPORTED;\r
83}\r
84\r