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