2023-03-10 10:32:50 +00:00
|
|
|
// This file is part of noxos and licensed under the MIT open source license
|
2023-02-28 20:13:51 +00:00
|
|
|
|
|
|
|
#ifndef NOX_ELF_H
|
|
|
|
#define NOX_ELF_H
|
|
|
|
|
2023-05-28 19:06:06 +00:00
|
|
|
#include "drivers/builtin/elf/header.h"
|
|
|
|
#include "drivers/builtin/elf/section.h"
|
|
|
|
#include "drivers/builtin/elf/mapping.h"
|
2023-02-28 20:13:51 +00:00
|
|
|
#include "utils/symbol.h"
|
|
|
|
|
|
|
|
typedef struct {
|
2023-02-28 21:17:55 +00:00
|
|
|
elf_header_T header;
|
2023-06-06 20:28:47 +00:00
|
|
|
symbol_table_T symbol_table;
|
2023-03-02 16:58:04 +00:00
|
|
|
uint64_t num_mappings;
|
|
|
|
elf_mapping_T* mappings;
|
2023-02-28 21:17:55 +00:00
|
|
|
void* string_table;
|
2023-02-28 20:13:51 +00:00
|
|
|
} elf_executable_T;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
elf_executable_T* executable;
|
|
|
|
elf_section_T* symbol_table;
|
|
|
|
elf_section_T* section_header_string_table;
|
|
|
|
|
|
|
|
uint8_t* buffer;
|
|
|
|
} elf_executable_temp_T;
|
|
|
|
|
|
|
|
elf_executable_T* elf_executable_create (uint8_t* buffer);
|
|
|
|
void elf_executable_destruct (elf_executable_T* executable);
|
|
|
|
|
|
|
|
#endif //NOX_ELF_H
|