ELF Loader: Fix linux build

This commit is contained in:
Dr. Chat 2017-03-07 12:33:18 -06:00
parent 3046df2415
commit 257fbfc408
1 changed files with 4 additions and 4 deletions

View File

@ -115,13 +115,13 @@ bool ElfModule::Load(const std::string& name, const std::string& path,
// Base address @ 0x80000000 // Base address @ 0x80000000
if (phdr[i].p_vaddr < 0x80000000 || phdr[i].p_vaddr > 0x9FFFFFFF) { if (phdr[i].p_vaddr < 0x80000000 || phdr[i].p_vaddr > 0x9FFFFFFF) {
XELOGE("ELF: Could not allocate memory for section @ address 0x%.8X", XELOGE("ELF: Could not allocate memory for section @ address 0x%.8X",
phdr[i].p_vaddr); uint32_t(phdr[i].p_vaddr));
return false; return false;
} }
uint32_t virtual_addr = phdr[i].p_vaddr & ~(phdr[i].p_align - 1); uint32_t virtual_addr = phdr[i].p_vaddr & ~(phdr[i].p_align - 1);
uint32_t virtual_size = uint32_t virtual_size = xe::round_up(phdr[i].p_vaddr + phdr[i].p_memsz,
xe::round_up(phdr[i].p_vaddr + phdr[i].p_memsz, phdr[i].p_align) - uint32_t(phdr[i].p_align)) -
virtual_addr; virtual_addr;
if (!memory() if (!memory()
->LookupHeap(virtual_addr) ->LookupHeap(virtual_addr)