mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-26 03:35:27 +00:00
Always add symbols, so we don't leave any behind.
This commit is contained in:
parent
c1834908b1
commit
7d44ea1ac8
@ -541,33 +541,19 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
|
||||
}
|
||||
}
|
||||
|
||||
bool hasSymbols = false;
|
||||
bool dontadd = false;
|
||||
|
||||
SectionID textSection = reader.GetSectionByName(".text");
|
||||
|
||||
if (textSection != -1) {
|
||||
u32 textStart = reader.GetSectionAddr(textSection);
|
||||
u32 textSize = reader.GetSectionSize(textSection);
|
||||
|
||||
if (!host->AttemptLoadSymbolMap())
|
||||
{
|
||||
hasSymbols = reader.LoadSymbols();
|
||||
if (!hasSymbols)
|
||||
{
|
||||
symbolMap.ResetSymbolMap();
|
||||
MIPSAnalyst::ScanForFunctions(textStart, textStart+textSize);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dontadd = true;
|
||||
}
|
||||
}
|
||||
else if (host->AttemptLoadSymbolMap())
|
||||
{
|
||||
dontadd = true;
|
||||
host->AttemptLoadSymbolMap();
|
||||
|
||||
if (!reader.LoadSymbols())
|
||||
MIPSAnalyst::ScanForFunctions(textStart, textStart+textSize);
|
||||
}
|
||||
else
|
||||
host->AttemptLoadSymbolMap();
|
||||
|
||||
INFO_LOG(LOADER,"Module %s: %08x %08x %08x", modinfo->name, modinfo->gp, modinfo->libent,modinfo->libstub);
|
||||
|
||||
@ -643,11 +629,9 @@ Module *__KernelLoadELFFromPtr(const u8 *ptr, u32 loadAddress, std::string *erro
|
||||
WARN_LOG_REPORT(LOADER, "Invalid address for syscall stub %s %08x", modulename, nidDataPtr[i]);
|
||||
}
|
||||
|
||||
if (!dontadd) {
|
||||
char temp[256];
|
||||
sprintf(temp,"zz_%s", GetFuncName(modulename, nidDataPtr[i]));
|
||||
symbolMap.AddSymbol(temp, addrToWriteSyscall, 8, ST_FUNCTION);
|
||||
}
|
||||
char temp[256];
|
||||
sprintf(temp,"zz_%s", GetFuncName(modulename, nidDataPtr[i]));
|
||||
symbolMap.AddSymbol(temp, addrToWriteSyscall, 8, ST_FUNCTION);
|
||||
}
|
||||
} else if (entry->numFuncs > 0) {
|
||||
WARN_LOG_REPORT(LOADER, "Module entry with %d imports but no valid address", entry->numFuncs);
|
||||
|
Loading…
x
Reference in New Issue
Block a user