mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-30 01:33:45 +01:00
Make previous code cleaner
This commit is contained in:
1 parent
c2851467e5
commit
e4ce0592c1
4 files changed
+62
-50
No files matched your search
@@ -271,7 +271,6 @@ bool ElfReader::LoadInto(u32 loadAddress)
|
||||
}
|
||||
|
||||
DEBUG_LOG(LOADER,"Relocations:");
|
||||
bool oldRelocs = false;
|
||||
|
||||
// Second pass: Do necessary relocations
|
||||
for (int i=0; i<GetNumSections(); i++)
|
||||
@@ -300,20 +299,23 @@ bool ElfReader::LoadInto(u32 loadAddress)
|
||||
else if (s->sh_type == SHT_REL)
|
||||
{
|
||||
DEBUG_LOG(LOADER, "Traditional relocation section found.");
|
||||
if (bRelocate)
|
||||
if (!bRelocate)
|
||||
{
|
||||
DEBUG_LOG(LOADER, "Binary is prerelocated. Skipping relocations.");
|
||||
}
|
||||
else
|
||||
{
|
||||
oldRelocs = true;
|
||||
//We have a relocation table!
|
||||
int sectionToModify = s->sh_info;
|
||||
if (!(sections[sectionToModify].sh_flags & SHF_ALLOC))
|
||||
{
|
||||
ERROR_LOG(LOADER,"Trying to relocate non-loaded section %s, ignoring",GetSectionName(sectionToModify));
|
||||
continue;
|
||||
}
|
||||
ERROR_LOG(LOADER,"Traditional relocations unsupported.");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oldRelocs)
|
||||
{
|
||||
INFO_LOG(LOADER, "Game uses old relocations (often for debugging, should be harmless)");
|
||||
}
|
||||
|
||||
// Segment relocations (a few games use them)
|
||||
if (GetNumSections() == 0)
|
||||
|
||||
Reference in new issue
Block a user