mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 01:29:41 +01:00
Workaround issue where some homebrew (like moppi-flower) would erroneously load into kernel ram where it won't fit
This commit is contained in:
1 parent
58b223e974
commit
04ce8a63e5
2 files changed
+11
-6
No files matched your search
@@ -393,7 +393,7 @@ int ElfReader::LoadInto(u32 loadAddress, bool fromTop)
|
||||
}
|
||||
|
||||
bool kernelModule = modInfo ? (modInfo->moduleAttrs & 0x1000) != 0 : false;
|
||||
BlockAllocator &memblock = kernelModule ? kernelMemory : userMemory;
|
||||
|
||||
std::string modName = "ELF";
|
||||
if (modInfo) {
|
||||
size_t n = strnlen(modInfo->name, 28);
|
||||
@@ -413,6 +413,11 @@ int ElfReader::LoadInto(u32 loadAddress, bool fromTop)
|
||||
}
|
||||
}
|
||||
totalSize = totalEnd - totalStart;
|
||||
|
||||
// If a load address is specified that's in regular RAM, override kernel module status
|
||||
bool inUser = totalStart > 0x08900000;
|
||||
BlockAllocator &memblock = (kernelModule && !inUser) ? kernelMemory : userMemory;
|
||||
|
||||
if (!bRelocate)
|
||||
{
|
||||
// Binary is prerelocated, load it where the first segment starts
|
||||
@@ -433,7 +438,7 @@ int ElfReader::LoadInto(u32 loadAddress, bool fromTop)
|
||||
ERROR_LOG_REPORT(LOADER, "Failed to allocate memory for ELF!");
|
||||
return SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED;
|
||||
}
|
||||
|
||||
|
||||
if (bRelocate) {
|
||||
DEBUG_LOG(LOADER,"Relocatable module");
|
||||
entryPoint += vaddr;
|
||||
|
||||
Reference in new issue
Block a user