TianoCore EDK2 master
|
#include "ElfLibInternal.h"
Go to the source code of this file.
Functions | |
Elf64_Shdr * | GetElf64SectionByIndex (IN UINT8 *ImageBase, IN UINT32 Index) |
Elf64_Phdr * | GetElf64SegmentByIndex (IN UINT8 *ImageBase, IN UINT32 Index) |
Elf64_Shdr * | GetElf64SectionByRange (IN UINT8 *ImageBase, IN UINT64 Offset, IN UINT64 Size) |
EFI_STATUS | ProcessRelocation64 (IN Elf64_Rela *Rela, IN UINT64 RelaSize, IN UINT64 RelaEntrySize, IN UINT64 RelaType, IN INT64 Delta, IN BOOLEAN DynamicLinking) |
EFI_STATUS | RelocateElf64Dynamic (IN ELF_IMAGE_CONTEXT *ElfCt) |
EFI_STATUS | RelocateElf64Sections (IN ELF_IMAGE_CONTEXT *ElfCt) |
EFI_STATUS | LoadElf64Image (IN ELF_IMAGE_CONTEXT *ElfCt) |
ELF library
Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Elf64Lib.c.
Elf64_Shdr * GetElf64SectionByIndex | ( | IN UINT8 * | ImageBase, |
IN UINT32 | Index | ||
) |
Return the section header specified by Index.
ImageBase | The image base. |
Index | The section index. |
Definition at line 20 of file Elf64Lib.c.
Elf64_Shdr * GetElf64SectionByRange | ( | IN UINT8 * | ImageBase, |
IN UINT64 | Offset, | ||
IN UINT64 | Size | ||
) |
Return the section header specified by the range.
ImageBase | The image base. |
Offset | The section offset. |
Size | The section size. |
Definition at line 69 of file Elf64Lib.c.
Elf64_Phdr * GetElf64SegmentByIndex | ( | IN UINT8 * | ImageBase, |
IN UINT32 | Index | ||
) |
Return the segment header specified by Index.
ImageBase | The image base. |
Index | The segment index. |
Definition at line 44 of file Elf64Lib.c.
EFI_STATUS LoadElf64Image | ( | IN ELF_IMAGE_CONTEXT * | ElfCt | ) |
Load ELF image which has 64-bit architecture.
Caller should set Context.ImageAddress to a proper value, either pointing to a new allocated memory whose size equal to Context.ImageSize, or pointing to Context.PreferredImageAddress.
[in] | ElfCt | ELF image context pointer. |
EFI_SUCCESS | ELF binary is loaded successfully. |
Others | Loading ELF binary fails. |
Definition at line 439 of file Elf64Lib.c.
EFI_STATUS ProcessRelocation64 | ( | IN Elf64_Rela * | Rela, |
IN UINT64 | RelaSize, | ||
IN UINT64 | RelaEntrySize, | ||
IN UINT64 | RelaType, | ||
IN INT64 | Delta, | ||
IN BOOLEAN | DynamicLinking | ||
) |
Fix up the image based on the relocation entries.
Rela | Relocation entries. |
RelaSize | Total size of relocation entries. |
RelaEntrySize | Relocation entry size. |
RelaType | Type of relocation entry. |
Delta | The delta between preferred image base and the actual image base. |
DynamicLinking | TRUE when fixing up according to dynamic relocation. |
EFI_SUCCESS | The image fix up is processed successfully. |
Definition at line 106 of file Elf64Lib.c.
EFI_STATUS RelocateElf64Dynamic | ( | IN ELF_IMAGE_CONTEXT * | ElfCt | ) |
Relocate the DYN type image.
ElfCt | Point to image context. |
EFI_SUCCESS | The relocation succeeds. |
EFI_UNSUPPORTED | The image doesn't contain a dynamic section. |
Definition at line 214 of file Elf64Lib.c.
EFI_STATUS RelocateElf64Sections | ( | IN ELF_IMAGE_CONTEXT * | ElfCt | ) |
Relocate all sections in a ELF image.
[in] | ElfCt | ELF image context pointer. |
EFI_UNSUPPORTED | Relocation is not supported. |
EFI_SUCCESS | ELF image was relocated successfully. |
Definition at line 358 of file Elf64Lib.c.