ELF file loader.
More...
#include <storage/storage.h>
#include "../application_manifest.h"
#include "elf_api_interface.h"
Go to the source code of this file.
|
typedef struct ELFFile | ELFFile |
|
typedef bool | ElfProcessSection(File *file, size_t offset, size_t size, void *context) |
|
|
enum | ELFFileLoadStatus { ELFFileLoadStatusSuccess = 0
, ELFFileLoadStatusUnspecifiedError
, ELFFileLoadStatusMissingImports
} |
|
enum | ElfProcessSectionResult { ElfProcessSectionResultNotFound
, ElfProcessSectionResultCannotProcess
, ElfProcessSectionResultSuccess
} |
|
enum | ElfLoadSectionTableResult { ElfLoadSectionTableResultError
, ElfLoadSectionTableResultNoMemory
, ElfLoadSectionTableResultSuccess
} |
|
◆ elf_file_alloc()
Allocate ELFFile instance.
- Parameters
-
- Returns
- ELFFile*
◆ elf_file_call_fini()
void elf_file_call_fini |
( |
ELFFile * | elf | ) |
|
Execute ELF file post-run stage, call static destructors for example (load stage #5) Must be done if any code from the ELF file was executed.
- Parameters
-
◆ elf_file_call_init()
void elf_file_call_init |
( |
ELFFile * | elf | ) |
|
Execute ELF file pre-run stage, call static constructors for example (load stage #3) Must be done before invoking any code from the ELF file.
- Parameters
-
◆ elf_file_clear_debug_info()
Clear ELF file debug info generated by elf_file_init_debug_info.
- Parameters
-
◆ elf_file_free()
void elf_file_free |
( |
ELFFile * | elf_file | ) |
|
Free ELFFile instance.
- Parameters
-
◆ elf_file_get_api_interface()
Get ELF file API interface.
- Parameters
-
- Returns
- const ElfApiInterface*
◆ elf_file_get_entry_point()
void * elf_file_get_entry_point |
( |
ELFFile * | elf_file | ) |
|
Get actual entry point for ELF file.
- Parameters
-
- Returns
- void*
◆ elf_file_init_debug_info()
Get ELF file debug info.
- Parameters
-
◆ elf_file_is_init_complete()
bool elf_file_is_init_complete |
( |
ELFFile * | elf | ) |
|
Check if ELF file pre-run stage was executed and its code is runnable.
- Parameters
-
◆ elf_file_load_section_table()
ElfLoadSectionTableResult elf_file_load_section_table |
( |
ELFFile * | elf_file | ) |
|
Load ELF file section table (load stage #1)
- Parameters
-
- Returns
- ElfLoadSectionTableResult
◆ elf_file_load_sections()
ELFFileLoadStatus elf_file_load_sections |
( |
ELFFile * | elf_file | ) |
|
Load and relocate ELF file sections (load stage #2)
- Parameters
-
- Returns
- ELFFileLoadStatus
◆ elf_file_open()
bool elf_file_open |
( |
ELFFile * | elf_file, |
|
|
const char * | path ) |
Open ELF file.
- Parameters
-
- Returns
- bool
◆ elf_process_section()
ElfProcessSectionResult elf_process_section |
( |
ELFFile * | elf_file, |
|
|
const char * | name, |
|
|
ElfProcessSection * | process_section, |
|
|
void * | context ) |
Process ELF file section.
- Parameters
-
elf_file | |
name | |
process_section | |
context | |
- Returns
- ElfProcessSectionResult