Run malloc_init before initializing libs

Allows LLE libSceMoveTracker.
This commit is contained in:
Stephen Miller 2026-03-01 11:20:23 -06:00
parent 4a5a47e53c
commit dcb5d4dd38
2 changed files with 12 additions and 2 deletions

View File

@ -172,13 +172,15 @@ void Linker::Execute(const std::vector<std::string>& 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{};

View File

@ -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);
}
}