rewrite sys_mmap() as sys_new_mmap()

This commit is contained in:
NAKAMURA Gou
2013-07-10 13:08:14 +09:00
parent dae884d572
commit 2aa5194958
10 changed files with 651 additions and 195 deletions

View File

@ -124,12 +124,18 @@ struct program_load_desc *load_elf(FILE *fp)
desc->sections[j].offset = phdr.p_offset;
desc->sections[j].len = phdr.p_memsz;
__dprintf("%d: (%s) %lx, %lx, %lx, %lx\n",
j, (phdr.p_type == PT_LOAD ? "PT_LOAD" : "PT_TLS"),
desc->sections[j].vaddr,
desc->sections[j].prot = PROT_NONE;
desc->sections[j].prot |= (phdr.p_flags & PF_R)? PROT_READ: 0;
desc->sections[j].prot |= (phdr.p_flags & PF_W)? PROT_WRITE: 0;
desc->sections[j].prot |= (phdr.p_flags & PF_X)? PROT_EXEC: 0;
__dprintf("%d: (%s) %lx, %lx, %lx, %lx, %x\n",
j, (phdr.p_type == PT_LOAD ? "PT_LOAD" : "PT_TLS"),
desc->sections[j].vaddr,
desc->sections[j].filesz,
desc->sections[j].offset,
desc->sections[j].len);
desc->sections[j].len,
desc->sections[j].prot);
j++;
if (!load_addr_set) {