TianoCore EDK2 master
|
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include "ElfLib.h"
#include "ElfCommon.h"
#include "Elf32.h"
#include "Elf64.h"
Go to the source code of this file.
Macros | |
#define | ELF_NEXT_ENTRY(EntryType, Current, EntrySize) ((EntryType *) ((UINT8 *)Current + EntrySize)) |
Functions | |
Elf32_Shdr * | GetElf32SectionByIndex (IN UINT8 *ImageBase, IN UINT32 Index) |
Elf64_Shdr * | GetElf64SectionByIndex (IN UINT8 *ImageBase, IN UINT32 Index) |
Elf32_Phdr * | GetElf32SegmentByIndex (IN UINT8 *ImageBase, IN UINT32 Index) |
Elf64_Phdr * | GetElf64SegmentByIndex (IN UINT8 *ImageBase, IN UINT32 Index) |
EFI_STATUS | LoadElf32Image (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 ElfLibInternal.h.
#define ELF_NEXT_ENTRY | ( | EntryType, | |
Current, | |||
EntrySize | |||
) | ((EntryType *) ((UINT8 *)Current + EntrySize)) |
Definition at line 20 of file ElfLibInternal.h.
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_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.
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_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 LoadElf32Image | ( | IN ELF_IMAGE_CONTEXT * | ElfCt | ) |
Load ELF image which has 32-bit architecture
[in] | ElfCt | ELF image context pointer. |
EFI_SUCCESS | ELF binary is loaded successfully. |
Others | Loading ELF binary fails. |
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 LoadElf64Image | ( | IN ELF_IMAGE_CONTEXT * | ElfCt | ) |
Load ELF image which has 64-bit architecture
[in] | ImageBase | Memory address of an image. |
[out] | EntryPoint | The entry point of loaded ELF image. |
EFI_SUCCESS | ELF binary is loaded successfully. |
Others | Loading ELF binary fails. |
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.