Loading...
Searching...
No Matches
elf_file_i.h
1#pragma once
2#include "elf_file.h"
3#include <m-dict.h>
4
5#ifdef __cplusplus
6extern "C" {
7#endif
8
9DICT_DEF2(AddressCache, int, M_DEFAULT_OPLIST, Elf32_Addr, M_DEFAULT_OPLIST) //-V1048
10
11
14typedef int32_t(entry_t)(void*);
15
16typedef struct ELFSection ELFSection;
17
18struct ELFSection {
19 void* data;
20 Elf32_Word size;
21
22 size_t rel_count;
23 Elf32_Off rel_offset;
24 ELFSection* fast_rel;
25
26 uint16_t sec_idx;
27};
28
29DICT_DEF2(ELFSectionDict, const char*, M_CSTR_OPLIST, ELFSection, M_POD_OPLIST)
30
31struct ELFFile {
32 size_t sections_count;
33 off_t section_table;
34 off_t section_table_strings;
35
36 size_t symbol_count;
37 off_t symbol_table;
38 off_t symbol_table_strings;
39 off_t entry;
40 ELFSectionDict_t sections;
41
42 AddressCache_t relocation_cache;
43 AddressCache_t trampoline_cache;
44
45 File* fd;
46 const ElfApiInterface* api_interface;
47 ELFDebugLinkInfo debug_link_info;
48
49 ELFSection* preinit_array;
50 ELFSection* init_array;
51 ELFSection* fini_array;
52
53 bool init_array_called;
54};
55
56#ifdef __cplusplus
57}
58#endif
ELF file loader.
Definition elf_file_i.h:31
Definition elf_file_i.h:18
Interface for ELF loader to resolve symbols.
Definition elf_api_interface.h:9
Structure that hold file index and returned api errors.
Definition filesystem_api_internal.h:17