3 Copyright (c) 2004 - 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 BasePeCoffLibInternals.h
18 Header file for Base PeCoff Library
22 #ifndef __BASE_PECOFF_LIB_INTERNALS__
23 #define __BASE_PECOFF_LIB_INTERNALS__
25 #include "EdkIIGlueBase.h"
28 Performs an Itanium-based specific relocation fixup and is a no-op on other
31 @param Reloc Pointer to the relocation record.
32 @param Fixup Pointer to the address to fix up.
33 @param FixupData Pointer to a buffer to log the fixups.
34 @param Adjust The offset to adjust the fixup.
40 GluePeCoffLoaderRelocateImageEx (
43 IN OUT CHAR8
**FixupData
,
49 Performs an Itanium-based specific re-relocation fixup and is a no-op on other
50 instruction sets. This is used to re-relocated the image into the EFI virtual
51 space for runtime calls.
53 @param Reloc Pointer to the relocation record.
54 @param Fixup Pointer to the address to fix up.
55 @param FixupData Pointer to a buffer to log the fixups.
56 @param Adjust The offset to adjust the fixup.
62 GluePeHotRelocateImageEx (
65 IN OUT CHAR8
**FixupData
,
71 Returns TRUE if the machine type of PE/COFF image is supported. Supported
72 does not mean the image can be executed it means the PE/COFF loader supports
73 loading and relocating of the image type. It's up to the caller to support
76 @param Machine Machine type from the PE Header.
78 @return TRUE if this PE/COFF loader can load the image
82 PeCoffLoaderImageFormatSupported (
87 Retrieves the magic value from the PE/COFF header.
89 @param Hdr The buffer in which to return the PE32, PE32+, or TE header.
91 @return EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC - Image is PE32
92 @return EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC - Image is PE32+
96 PeCoffLoaderGetPeHeaderMagicValue (
97 IN EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr
101 Retrieves the PE or TE Header from a PE/COFF or TE image.
103 @param ImageContext The context of the image being loaded.
104 @param Hdr The buffer in which to return the PE32, PE32+, or TE header.
106 @retval RETURN_SUCCESS The PE or TE Header is read.
107 @retval Other The error status from reading the PE/COFF or TE image using the ImageRead function.
111 PeCoffLoaderGetPeHeader (
112 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
,
113 OUT EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION Hdr
117 Converts an image address to the loaded address.
119 @param ImageContext The context of the image being loaded.
120 @param Address The address to be converted to the loaded address.
122 @return The converted address or NULL if the address can not be converted.
126 PeCoffLoaderImageAddress (
127 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
,