relocate before execution

This commit is contained in:
georgemoralis 2024-03-26 17:33:48 +02:00
parent e5a224aa96
commit bc7228fcb2
1 changed files with 3 additions and 1 deletions

View File

@ -75,7 +75,6 @@ Module* Linker::LoadModule(const std::filesystem::path& elf_name) {
LoadModuleToMemory(m.get()); LoadModuleToMemory(m.get());
LoadDynamicInfo(m.get()); LoadDynamicInfo(m.get());
LoadSymbols(m.get()); LoadSymbols(m.get());
Relocate(m.get());
} else { } else {
m_modules.pop_back(); m_modules.pop_back();
return nullptr; // It is not a valid elf file //TODO check it why! return nullptr; // It is not a valid elf file //TODO check it why!
@ -639,6 +638,9 @@ void Linker::Execute() {
} }
Core::Libraries::LibKernel::pthreadInitSelfMainThread(); Core::Libraries::LibKernel::pthreadInitSelfMainThread();
for (const auto& m : m_modules) {
Relocate(m.get());
}
EntryParams p{}; EntryParams p{};
p.argc = 1; p.argc = 1;
p.argv[0] = "eboot.bin"; // hmm should be ok? p.argv[0] = "eboot.bin"; // hmm should be ok?