155,11 → 155,17 |
return EE_INCOMPATIBLE; |
} |
|
if (header->e_phentsize != sizeof(elf_segment_header_t)) |
if (header->e_phentsize != sizeof(elf_segment_header_t)) { |
printf("e_phentsize:%d != %d\n", header->e_phentsize, |
sizeof(elf_segment_header_t)); |
return EE_INCOMPATIBLE; |
} |
|
if (header->e_shentsize != sizeof(elf_section_header_t)) |
if (header->e_shentsize != sizeof(elf_section_header_t)) { |
printf("e_shentsize:%d != %d\n", header->e_shentsize, |
sizeof(elf_section_header_t)); |
return EE_INCOMPATIBLE; |
} |
|
/* Check if the object type is supported. */ |
if (header->e_type != ET_EXEC && header->e_type != ET_DYN) { |
293,6 → 299,8 |
} |
} |
|
/* Final flags that will be set for the memory area */ |
|
if (entry->p_flags & PF_X) |
flags |= AS_AREA_EXEC; |
if (entry->p_flags & PF_W) |
301,9 → 309,6 |
flags |= AS_AREA_READ; |
flags |= AS_AREA_CACHEABLE; |
|
/* Final flags for the memory area */ |
flags = AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE; |
|
/* |
* Check if the virtual address starts on page boundary. |
*/ |
328,8 → 333,8 |
return EE_MEMORY; |
} |
|
printf("as_area_create(0x%x, 0x%x, %d) -> 0x%x\n", |
entry->p_vaddr+bias, entry->p_memsz, flags, (unsigned)a); |
printf("as_area_create(0x%lx, 0x%x, %d) -> 0x%lx\n", |
entry->p_vaddr+bias, entry->p_memsz, flags, (uintptr_t)a); |
|
/* |
* Load segment data |