mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-23 03:02:53 +01:00
Something is wrong with entry points...
This commit is contained in:
parent
df72f5e37c
commit
43382a0ac6
@ -383,10 +383,24 @@ void Emulator::Load()
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
thread.SetEntry(l.GetEntry());
|
||||
case MACHINE_ARM:
|
||||
{
|
||||
u32 entry = l.GetEntry();
|
||||
|
||||
auto code = vm::psv::ptr<const u32>::make(entry & ~3);
|
||||
|
||||
// evil way to find entry point in .sceModuleInfo.rodata
|
||||
while (code[0] != 0xffffffffu)
|
||||
{
|
||||
entry = code[0] + 0x81000000;
|
||||
code++;
|
||||
}
|
||||
|
||||
thread.SetEntry(entry & ~1);
|
||||
thread.Run();
|
||||
break;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_status = Ready;
|
||||
|
@ -352,7 +352,7 @@ bool ELF32Loader::LoadPhdrInfo()
|
||||
|
||||
for(size_t i=0; i<phdr_arr.size(); ++i)
|
||||
{
|
||||
if(phdr_arr[i].p_paddr >= entry && entry < phdr_arr[i].p_paddr + phdr_arr[i].p_memsz)
|
||||
if(phdr_arr[i].p_offset >= entry && entry < phdr_arr[i].p_offset + phdr_arr[i].p_memsz)
|
||||
{
|
||||
entry += phdr_arr[i].p_vaddr;
|
||||
LOG_WARNING(LOADER, "virtual entry = 0x%x", entry);
|
||||
@ -360,6 +360,10 @@ bool ELF32Loader::LoadPhdrInfo()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (machine == MACHINE_ARM)
|
||||
{
|
||||
entry += 0x81000000;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -601,7 +605,7 @@ bool ELF32Loader::LoadShdrData(u64 offset)
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(LOADER, "sceRefs: unknown code found (code=0x%x, code1=0x%x, code2=0x%x, code3=0x%x)", rel[j].code, rel[j].code1, rel[j].code2, rel[j].code3);
|
||||
LOG_NOTICE(LOADER, "sceRefs: unknown code found (code=0x%x, code1=0x%x, code2=0x%x, code3=0x%x)", rel[j].code, rel[j].code1, rel[j].code2, rel[j].code3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ struct Elf32_Ehdr
|
||||
u16 e_type;
|
||||
u16 e_machine;
|
||||
u32 e_version;
|
||||
u16 e_entry;
|
||||
u32 e_entry;
|
||||
u32 e_phoff;
|
||||
u32 e_shoff;
|
||||
u32 e_flags;
|
||||
|
Loading…
Reference in New Issue
Block a user