Backed out changeset 10b47593c4d7 (bug 824715)

This commit is contained in:
Josh Matthews 2012-12-28 19:03:50 -05:00
parent 59c8c84079
commit 9d82867b14

View File

@ -439,7 +439,7 @@ CustomElf::LoadSegment(const Phdr *pt_load) const
if (pt_load->p_memsz > pt_load->p_filesz) {
Addr file_end = pt_load->p_vaddr + pt_load->p_filesz;
Addr mem_end = pt_load->p_vaddr + pt_load->p_memsz;
Addr next_page = (file_end + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1);
Addr next_page = (file_end & ~(PAGE_SIZE - 1)) + PAGE_SIZE;
if (mem_end > next_page) {
if (mprotect(GetPtr(next_page), mem_end - next_page, prot) < 0) {
log("%s: Failed to mprotect", GetPath());