From dcb5d4dd38ca239005526d7e02aaf9d6e9e28f30 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Sun, 1 Mar 2026 11:20:23 -0600 Subject: [PATCH] Run malloc_init before initializing libs Allows LLE libSceMoveTracker. --- src/core/linker.cpp | 4 +++- src/core/linker.h | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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); } }