initial dynamic loader , parsing DT_HASH atm

This commit is contained in:
georgemoralis 2023-06-08 12:51:11 +03:00
parent e02c0a9398
commit 672e2b2d77
3 changed files with 41 additions and 0 deletions

View file

@ -2,6 +2,8 @@
#include "../../Loader/Elf.h"
#include <vector>
struct DynamicModuleInfo;
/*this struct keeps neccesary info about loaded modules.Main executeable is included too as well*/
struct Module
{
@ -11,6 +13,12 @@ struct Module
void* m_dynamic = nullptr;
void* m_dynamic_data = nullptr;
DynamicModuleInfo* dynamic_info = nullptr;
};
struct DynamicModuleInfo
{
void* hash_table = nullptr;
};
class Linker
@ -22,6 +30,7 @@ public:
Module* LoadModule(const std::string& elf_name);
Module* FindModule(/*u32 id*/);
void LoadModuleToMemory(Module* m);
void LoadDynamicInfo(Module* program);
private:
std::vector<Module*> m_modules;