]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BasePeCoffLib/PeCoffLoaderEx.c
OVMF: Align PE images in ROM, and strip relocations were possible.
[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
2bfb6009 4 Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
d071fb19 5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
d071fb19 13**/\r
14\r
f734a10a 15#include "BasePeCoffLibInternals.h"\r
d071fb19 16\r
17\r
d071fb19 18/**\r
efb23117 19 Performs an Itanium-based specific relocation fixup and is a no-op on other\r
20 instruction sets.\r
d071fb19 21\r
22 @param Reloc Pointer to the relocation record.\r
23 @param Fixup Pointer to the address to fix up.\r
24 @param FixupData Pointer to a buffer to log the fixups.\r
25 @param Adjust The offset to adjust the fixup.\r
26\r
efb23117 27 @return Status code.\r
d071fb19 28\r
29**/\r
30RETURN_STATUS\r
31PeCoffLoaderRelocateImageEx (\r
32 IN UINT16 *Reloc,\r
33 IN OUT CHAR8 *Fixup,\r
34 IN OUT CHAR8 **FixupData,\r
35 IN UINT64 Adjust\r
36 )\r
37{\r
38 return RETURN_UNSUPPORTED;\r
39}\r
40\r
41/**\r
efb23117 42 Returns TRUE if the machine type of PE/COFF image is supported. Supported\r
d071fb19 43 does not mean the image can be executed it means the PE/COFF loader supports\r
44 loading and relocating of the image type. It's up to the caller to support\r
efb23117 45 the entry point.\r
981b0f90
LG
46 \r
47 The IA32/X64 version PE/COFF loader/relocater both support IA32, X64 and EBC images.\r
d071fb19 48\r
49 @param Machine Machine type from the PE Header.\r
50\r
51 @return TRUE if this PE/COFF loader can load the image\r
52\r
53**/\r
54BOOLEAN\r
55PeCoffLoaderImageFormatSupported (\r
56 IN UINT16 Machine\r
57 )\r
58{\r
4ab0dff3 59 if ((Machine == IMAGE_FILE_MACHINE_I386) || (Machine == IMAGE_FILE_MACHINE_X64) || \r
60 (Machine == IMAGE_FILE_MACHINE_EBC)) {\r
d071fb19 61 return TRUE; \r
62 }\r
63\r
64 return FALSE;\r
65}\r
66\r
67/**\r
68 Performs an Itanium-based specific re-relocation fixup and is a no-op on other\r
69 instruction sets. This is used to re-relocated the image into the EFI virtual\r
70 space for runtime calls.\r
71\r
72 @param Reloc Pointer to the relocation record.\r
73 @param Fixup Pointer to the address to fix up.\r
74 @param FixupData Pointer to a buffer to log the fixups.\r
75 @param Adjust The offset to adjust the fixup.\r
76\r
efb23117 77 @return Status code.\r
d071fb19 78\r
79**/\r
80RETURN_STATUS\r
81PeHotRelocateImageEx (\r
82 IN UINT16 *Reloc,\r
83 IN OUT CHAR8 *Fixup,\r
84 IN OUT CHAR8 **FixupData,\r
85 IN UINT64 Adjust\r
86 )\r
87{\r
88 return RETURN_UNSUPPORTED;\r
89}\r
90\r