some more progress on linker , elf is now load from there

This commit is contained in:
georgemoralis 2023-05-23 10:47:56 +03:00
parent a09e2eb65a
commit b27942c46b
3 changed files with 29 additions and 4 deletions

View file

@ -11,6 +11,22 @@ Linker::~Linker()
Module* Linker::LoadModule(const std::string& elf_name)
{
auto* m = new Module;
m->elf = new Elf;
m->elf->Open(elf_name);//load elf
m_modules.push_back(m);//added it to load modules
return m;
}
Module* Linker::FindModule(/*u32 id*/)
{
//find module . TODO atm we only have 1 module so we don't need to iterate on vector
Module* m = m_modules.at(0);
if (m)
{
return m;
}
return nullptr;
}