mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-28 14:23:18 +00:00
some more progress on linker , elf is now load from there
This commit is contained in:
parent
a09e2eb65a
commit
b27942c46b
3 changed files with 29 additions and 4 deletions
|
@ -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;
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include "../../Loader/Elf.h"
|
||||
#include <vector>
|
||||
|
||||
/*this struct keeps neccesary info about loaded modules.Main executeable is included too as well*/
|
||||
struct Module
|
||||
|
@ -14,4 +15,8 @@ public:
|
|||
virtual ~Linker();
|
||||
|
||||
Module* LoadModule(const std::string& elf_name);
|
||||
Module* FindModule(/*u32 id*/);
|
||||
|
||||
private:
|
||||
std::vector<Module*> m_modules;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue