Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define EXT_IMM64 | ( | Value, | |||
Address, | |||||
Size, | |||||
InstPos, | |||||
ValPos | ) | Value |= (((UINT64)((*(Address) >> InstPos) & (((UINT64)1 << Size) - 1))) << ValPos) |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IC_INST_WORD_POS_X 12 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IC_INST_WORD_X 3 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IC_SIZE_X 1 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IC_VAL_POS_X 21 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41A_INST_WORD_POS_X 14 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41A_INST_WORD_X 1 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41A_SIZE_X 10 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41A_VAL_POS_X 22 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41B_INST_WORD_POS_X 24 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41B_INST_WORD_X 1 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41B_SIZE_X 8 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41B_VAL_POS_X 32 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41C_INST_WORD_POS_X 0 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41C_INST_WORD_X 2 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41C_SIZE_X 23 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM41C_VAL_POS_X 40 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM5C_INST_WORD_POS_X 13 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM5C_INST_WORD_X 3 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM5C_SIZE_X 5 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM5C_VAL_POS_X 16 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM7B_INST_WORD_POS_X 4 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM7B_INST_WORD_X 3 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM7B_SIZE_X 7 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM7B_VAL_POS_X 0 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM9D_INST_WORD_POS_X 18 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM9D_INST_WORD_X 3 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM9D_SIZE_X 9 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_IMM9D_VAL_POS_X 7 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_SIGN_INST_WORD_POS_X 27 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_SIGN_INST_WORD_X 3 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_SIGN_SIZE_X 1 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define IMM64_SIGN_VAL_POS_X 63 |
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
#define INS_IMM64 | ( | Value, | |||
Address, | |||||
Size, | |||||
InstPos, | |||||
ValPos | ) |
Value:
*(UINT32*)Address = (*(UINT32*)Address & ~(((1 << Size) - 1) << InstPos)) | \ ((UINT32)((((UINT64)Value >> ValPos) & (((UINT64)1 << Size) - 1))) << InstPos)
Referenced by PeCoffLoaderRelocateImageEx(), and PeHotRelocateImageEx().
Returns TRUE if the machine type of PE/COFF image is supported. Supported does not mean the image can be executed it means the PE/COFF loader supports loading and relocating of the image type. It's up to the caller to support the entry point.
The itanium version PE/COFF loader/relocater supports itanium and EBC image.
Machine | Machine type from the PE Header. |
FALSE unrecoganized machine type of image.
References FALSE, IMAGE_FILE_MACHINE_EBC, IMAGE_FILE_MACHINE_IA64, and TRUE.
RETURN_STATUS PeCoffLoaderRelocateImageEx | ( | IN UINT16 * | Reloc, | |
IN OUT CHAR8 * | Fixup, | |||
IN OUT CHAR8 ** | FixupData, | |||
IN UINT64 | Adjust | |||
) |
Performs an Itanium-based specific relocation fixup.
Reloc | The pointer to the relocation record. | |
Fixup | The pointer to the address to fix up. | |
FixupData | The pointer to a buffer to log the fixups. | |
Adjust | The offset to adjust the fixup. |
RETURN_SUCCESS | Succeed to fix the relocation entry. | |
RETURN_UNSUPPOTED | Unrecoganized relocation entry. |
References ALIGN_POINTER, EFI_IMAGE_REL_BASED_IA64_IMM64, EXT_IMM64, IMM64_IC_INST_WORD_POS_X, IMM64_IC_INST_WORD_X, IMM64_IC_SIZE_X, IMM64_IC_VAL_POS_X, IMM64_IMM41A_INST_WORD_POS_X, IMM64_IMM41A_INST_WORD_X, IMM64_IMM41A_SIZE_X, IMM64_IMM41A_VAL_POS_X, IMM64_IMM41B_INST_WORD_POS_X, IMM64_IMM41B_INST_WORD_X, IMM64_IMM41B_SIZE_X, IMM64_IMM41B_VAL_POS_X, IMM64_IMM41C_INST_WORD_POS_X, IMM64_IMM41C_INST_WORD_X, IMM64_IMM41C_SIZE_X, IMM64_IMM41C_VAL_POS_X, IMM64_IMM5C_INST_WORD_POS_X, IMM64_IMM5C_INST_WORD_X, IMM64_IMM5C_SIZE_X, IMM64_IMM5C_VAL_POS_X, IMM64_IMM7B_INST_WORD_POS_X, IMM64_IMM7B_INST_WORD_X, IMM64_IMM7B_SIZE_X, IMM64_IMM7B_VAL_POS_X, IMM64_IMM9D_INST_WORD_POS_X, IMM64_IMM9D_INST_WORD_X, IMM64_IMM9D_SIZE_X, IMM64_IMM9D_VAL_POS_X, IMM64_SIGN_INST_WORD_POS_X, IMM64_SIGN_INST_WORD_X, IMM64_SIGN_SIZE_X, IMM64_SIGN_VAL_POS_X, INS_IMM64, NULL, RETURN_SUCCESS, and RETURN_UNSUPPORTED.
RETURN_STATUS PeHotRelocateImageEx | ( | IN UINT16 * | Reloc, | |
IN OUT CHAR8 * | Fixup, | |||
IN OUT CHAR8 ** | FixupData, | |||
IN UINT64 | Adjust | |||
) |
ImageRead function that operates on a memory buffer whos base is passed into FileHandle.
Reloc | Ponter to baes of the input stream | |
Fixup | Offset to the start of the buffer | |
FixupData | The number of bytes to copy into the buffer | |
Adjust | Location to place results of read |
RETURN_SUCCESS | Data is read from FileOffset from the Handle into the buffer. | |
RETURN_UNSUPPORTED | Un-recoganized relocation entry type. |
References ALIGN_POINTER, DEBUG, EFI_D_ERROR, EFI_IMAGE_REL_BASED_DIR64, EFI_IMAGE_REL_BASED_IA64_IMM64, EXT_IMM64, IMM64_IC_INST_WORD_POS_X, IMM64_IC_INST_WORD_X, IMM64_IC_SIZE_X, IMM64_IC_VAL_POS_X, IMM64_IMM41A_INST_WORD_POS_X, IMM64_IMM41A_INST_WORD_X, IMM64_IMM41A_SIZE_X, IMM64_IMM41A_VAL_POS_X, IMM64_IMM41B_INST_WORD_POS_X, IMM64_IMM41B_INST_WORD_X, IMM64_IMM41B_SIZE_X, IMM64_IMM41B_VAL_POS_X, IMM64_IMM41C_INST_WORD_POS_X, IMM64_IMM41C_INST_WORD_X, IMM64_IMM41C_SIZE_X, IMM64_IMM41C_VAL_POS_X, IMM64_IMM5C_INST_WORD_POS_X, IMM64_IMM5C_INST_WORD_X, IMM64_IMM5C_SIZE_X, IMM64_IMM5C_VAL_POS_X, IMM64_IMM7B_INST_WORD_POS_X, IMM64_IMM7B_INST_WORD_X, IMM64_IMM7B_SIZE_X, IMM64_IMM7B_VAL_POS_X, IMM64_IMM9D_INST_WORD_POS_X, IMM64_IMM9D_INST_WORD_X, IMM64_IMM9D_SIZE_X, IMM64_IMM9D_VAL_POS_X, IMM64_SIGN_INST_WORD_POS_X, IMM64_SIGN_INST_WORD_X, IMM64_SIGN_SIZE_X, IMM64_SIGN_VAL_POS_X, INS_IMM64, RETURN_SUCCESS, and RETURN_UNSUPPORTED.