mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Module: Avoid scanning stubs if possible.
In this case, we often scan some garbage, but let's reduce it at least.
This commit is contained in:
parent
00a05e97ac
commit
29ed48c32a
1 changed files with 12 additions and 1 deletions
|
@ -1283,7 +1283,18 @@ static Module *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 loadAdd
|
|||
|
||||
// Some games don't have any sections at all.
|
||||
if (scan && codeSections.empty()) {
|
||||
MIPSAnalyst::ScanForFunctions(module->textStart, module->textEnd, !gotSymbols);
|
||||
u32 scanStart = module->textStart;
|
||||
u32 scanEnd = module->textEnd;
|
||||
// Skip the exports and imports sections, they're not code.
|
||||
if (scanEnd >= std::min(modinfo->libent, modinfo->libstub)) {
|
||||
MIPSAnalyst::ScanForFunctions(scanStart, std::min(modinfo->libent, modinfo->libstub) - 4, !gotSymbols);
|
||||
scanStart = std::min(modinfo->libentend, modinfo->libstubend);
|
||||
}
|
||||
if (scanEnd >= std::max(modinfo->libent, modinfo->libstub)) {
|
||||
MIPSAnalyst::ScanForFunctions(scanStart, std::max(modinfo->libent, modinfo->libstub) - 4, !gotSymbols);
|
||||
scanStart = std::max(modinfo->libentend, modinfo->libstubend);
|
||||
}
|
||||
MIPSAnalyst::ScanForFunctions(scanStart, scanEnd, !gotSymbols);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue