mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 08:39:51 +00:00
Don't require 32-bit relocs to be aligned.
Also, report these situations more, who knows what games they could break.
This commit is contained in:
parent
f165a15eff
commit
b9feae3b62
@ -69,18 +69,18 @@ bool ElfReader::LoadRelocations(Elf32_Rel *rels, int numRelocs)
|
||||
//0 = code
|
||||
//1 = data
|
||||
|
||||
if (readwrite >= ARRAY_SIZE(segmentVAddr)) {
|
||||
if (readwrite >= (int)ARRAY_SIZE(segmentVAddr)) {
|
||||
if (numErrors < 10) {
|
||||
ERROR_LOG(LOADER, "Bad segment number %i", readwrite);
|
||||
ERROR_LOG_REPORT(LOADER, "Bad segment number %i", readwrite);
|
||||
}
|
||||
numErrors++;
|
||||
continue;
|
||||
}
|
||||
|
||||
addr += segmentVAddr[readwrite];
|
||||
if ((addr & 3) || !Memory::IsValidAddress(addr)) {
|
||||
if (((addr & 3) && type != R_MIPS_32) || !Memory::IsValidAddress(addr)) {
|
||||
if (numErrors < 10) {
|
||||
WARN_LOG(LOADER, "Suspicious address %08x, skipping reloc", addr);
|
||||
WARN_LOG_REPORT(LOADER, "Suspicious address %08x, skipping reloc, type = %d", addr, type);
|
||||
} else if (numErrors == 10) {
|
||||
WARN_LOG(LOADER, "Too many bad relocations, skipping logging");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user