More correct elf loader (#1839)

* ELF File: more robust section loader
* ELF File: faster and smaller preinit, init and fini arrays handling
* ELF File: load sections on preload stage
* ELF File: naming
* Furi: fix use after free in thread join

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Sergey Gavrilov
2022-10-08 03:06:29 +10:00
committed by GitHub
parent 1a1f711897
commit 37b5e58a60
4 changed files with 100 additions and 130 deletions

View File

@@ -16,8 +16,10 @@ typedef int32_t(entry_t)(void*);
typedef struct {
void* data;
uint16_t sec_idx;
uint16_t rel_sec_idx;
Elf32_Word size;
size_t rel_count;
Elf32_Off rel_offset;
} ELFSection;
DICT_DEF2(ELFSectionDict, const char*, M_CSTR_OPLIST, ELFSection, M_POD_OPLIST)
@@ -39,6 +41,10 @@ struct ELFFile {
File* fd;
const ElfApiInterface* api_interface;
ELFDebugLinkInfo debug_link_info;
ELFSection* preinit_array;
ELFSection* init_array;
ELFSection* fini_array;
};
#ifdef __cplusplus