TianoCore EDK2 master
|
#include "ElfLibInternal.h"
Go to the source code of this file.
Functions | |
Elf32_Shdr * | GetElf32SectionByIndex (IN UINT8 *ImageBase, IN UINT32 Index) |
Elf32_Phdr * | GetElf32SegmentByIndex (IN UINT8 *ImageBase, IN UINT32 Index) |
Elf32_Shdr * | GetElf32SectionByRange (IN UINT8 *ImageBase, IN UINT32 Offset, IN UINT32 Size) |
EFI_STATUS | ProcessRelocation32 (IN Elf32_Rela *Rela, IN UINT32 RelaSize, IN UINT32 RelaEntrySize, IN UINT32 RelaType, IN INTN Delta, IN BOOLEAN DynamicLinking) |
EFI_STATUS | RelocateElf32Dynamic (IN ELF_IMAGE_CONTEXT *ElfCt) |
EFI_STATUS | RelocateElf32Sections (IN ELF_IMAGE_CONTEXT *ElfCt) |
EFI_STATUS | LoadElf32Image (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 Elf32Lib.c.
Elf32_Shdr * GetElf32SectionByIndex | ( | 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 Elf32Lib.c.
Elf32_Shdr * GetElf32SectionByRange | ( | IN UINT8 * | ImageBase, |
IN UINT32 | Offset, | ||
IN UINT32 | 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 Elf32Lib.c.
Elf32_Phdr * GetElf32SegmentByIndex | ( | 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 Elf32Lib.c.
EFI_STATUS LoadElf32Image | ( | IN ELF_IMAGE_CONTEXT * | ElfCt | ) |
Load ELF image which has 32-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 430 of file Elf32Lib.c.
EFI_STATUS ProcessRelocation32 | ( | IN Elf32_Rela * | Rela, |
IN UINT32 | RelaSize, | ||
IN UINT32 | RelaEntrySize, | ||
IN UINT32 | RelaType, | ||
IN INTN | 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 Elf32Lib.c.
EFI_STATUS RelocateElf32Dynamic | ( | 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 205 of file Elf32Lib.c.
EFI_STATUS RelocateElf32Sections | ( | 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 349 of file Elf32Lib.c.