TianoCore EDK2 master
Loading...
Searching...
No Matches
ElfLib.h
Go to the documentation of this file.
1
9#ifndef ELF_LIB_H_
10#define ELF_LIB_H_
11
12#include <PiPei.h>
13
14#define ELF_CLASS32 1
15#define ELF_CLASS64 2
16
17#define ELF_PT_LOAD 1
18
19typedef struct {
20 RETURN_STATUS ParseStatus;
21 UINT8 *FileBase;
25 UINT8 *ImageAddress;
27 UINT32 EiClass;
28 UINT32 ShNum;
29 UINT32 PhNum;
30 UINTN ShStrOff;
31 UINTN ShStrLen;
34
35typedef struct {
36 UINT32 PtType;
37 UINTN Offset;
38 UINTN Length;
39 UINTN MemLen;
40 UINTN MemAddr;
41 UINTN Alignment;
43
56EFIAPI
58 IN VOID *ImageBase,
60 );
61
76EFIAPI
79 );
80
93EFIAPI
95 IN ELF_IMAGE_CONTEXT *ElfCt,
96 IN UINT32 SectionIndex,
97 OUT CHAR8 **SectionName
98 );
99
114EFIAPI
116 IN ELF_IMAGE_CONTEXT *ElfCt,
117 IN UINT32 Index,
118 OUT UINTN *Offset,
119 OUT UINTN *Size
120 );
121
122#endif /* ELF_LIB_H_ */
UINT64 UINTN
EFI_STATUS EFIAPI LoadElfImage(IN ELF_IMAGE_CONTEXT *ElfCt)
Definition: ElfLib.c:351
EFI_STATUS EFIAPI GetElfSectionName(IN ELF_IMAGE_CONTEXT *ElfCt, IN UINT32 SectionIndex, OUT CHAR8 **SectionName)
Definition: ElfLib.c:392
EFI_STATUS EFIAPI GetElfSectionPos(IN ELF_IMAGE_CONTEXT *ElfCt, IN UINT32 Index, OUT UINTN *Offset, OUT UINTN *Size)
Definition: ElfLib.c:446
EFI_STATUS EFIAPI ParseElfImage(IN VOID *ImageBase, OUT ELF_IMAGE_CONTEXT *ElfCt)
Definition: ElfLib.c:229
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
UINTN FileSize
The size including sections that don't require loading.
Definition: ElfLib.h:22
UINT8 * ImageAddress
The destination memory address set by caller.
Definition: ElfLib.h:25
UINTN EntryPoint
Return the actual entry point after LoadElfImage().
Definition: ElfLib.h:32
UINT8 * PreferredImageAddress
The preferred image to be loaded. No relocation is needed if loaded to this address.
Definition: ElfLib.h:23
UINTN ImageSize
The memory size for loading and execution.
Definition: ElfLib.h:26
RETURN_STATUS ParseStatus
Return the status after ParseElfImage().
Definition: ElfLib.h:20
UINT8 * FileBase
The source location in memory.
Definition: ElfLib.h:21
BOOLEAN ReloadRequired
The image needs a new memory location for running.
Definition: ElfLib.h:24