From bc7228fcb2a523038f18d3b8c15209c001d4d774 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Tue, 26 Mar 2024 17:33:48 +0200 Subject: [PATCH] relocate before execution --- src/core/linker.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/linker.cpp b/src/core/linker.cpp index 1dd38f30..653d853a 100644 --- a/src/core/linker.cpp +++ b/src/core/linker.cpp @@ -75,7 +75,6 @@ Module* Linker::LoadModule(const std::filesystem::path& elf_name) { LoadModuleToMemory(m.get()); LoadDynamicInfo(m.get()); LoadSymbols(m.get()); - Relocate(m.get()); } else { m_modules.pop_back(); return nullptr; // It is not a valid elf file //TODO check it why! @@ -639,6 +638,9 @@ void Linker::Execute() { } Core::Libraries::LibKernel::pthreadInitSelfMainThread(); + for (const auto& m : m_modules) { + Relocate(m.get()); + } EntryParams p{}; p.argc = 1; p.argv[0] = "eboot.bin"; // hmm should be ok?