mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-12 19:27:58 -05:00
Core: Properly configure address space when loading a binary
The code now properly configures the process image to match the loaded binary segments (code, rodata, data) instead of just blindly allocating a large chunk of dummy memory.
This commit is contained in:
@ -35,6 +35,10 @@ VMManager::VMManager() {
|
||||
Reset();
|
||||
}
|
||||
|
||||
VMManager::~VMManager() {
|
||||
Reset();
|
||||
}
|
||||
|
||||
void VMManager::Reset() {
|
||||
vma_map.clear();
|
||||
|
||||
@ -130,6 +134,16 @@ void VMManager::Reprotect(VMAHandle vma_handle, VMAPermission new_perms) {
|
||||
MergeAdjacent(iter);
|
||||
}
|
||||
|
||||
void VMManager::LogLayout() const {
|
||||
for (const auto& p : vma_map) {
|
||||
const VirtualMemoryArea& vma = p.second;
|
||||
LOG_DEBUG(Kernel, "%08X - %08X size: %8X %c%c%c", vma.base, vma.base + vma.size, vma.size,
|
||||
(u8)vma.permissions & (u8)VMAPermission::Read ? 'R' : '-',
|
||||
(u8)vma.permissions & (u8)VMAPermission::Write ? 'W' : '-',
|
||||
(u8)vma.permissions & (u8)VMAPermission::Execute ? 'X' : '-');
|
||||
}
|
||||
}
|
||||
|
||||
VMManager::VMAIter VMManager::StripIterConstness(const VMAHandle & iter) {
|
||||
// This uses a neat C++ trick to convert a const_iterator to a regular iterator, given
|
||||
// non-const access to its container.
|
||||
|
Reference in New Issue
Block a user