diff --git a/src/core/linker.cpp b/src/core/linker.cpp index ef7bc0d45..10b73f023 100644 --- a/src/core/linker.cpp +++ b/src/core/linker.cpp @@ -172,13 +172,15 @@ void Linker::Execute(const std::vector& args) { ipc.WaitForStart(); } - LoadSharedLibraries(); + LoadLibcInternal(); if (malloc_init != nullptr) { // Call _malloc_init malloc_init(); } + LoadSharedLibraries(); + // Simulate libSceGnmDriver initialization, which maps a chunk of direct memory. // Some games fail without accurately emulating this behavior. s64 phys_addr{}; diff --git a/src/core/linker.h b/src/core/linker.h index b4a26ae39..e2efccbb0 100644 --- a/src/core/linker.h +++ b/src/core/linker.h @@ -124,9 +124,17 @@ public: } } + void LoadLibcInternal() { + for (auto& module : m_modules) { + if (module->name.contains("libSceLibcInternal")) { + module->Start(0, nullptr, nullptr); + } + } + } + void LoadSharedLibraries() { for (auto& module : m_modules) { - if (module->IsSharedLib()) { + if (module->IsSharedLib() && !module->name.contains("libSceLibcInternal")) { module->Start(0, nullptr, nullptr); } }