Hi!
Thank you for your answer!
he is telling you what ELF_START_MMAP is all about. it is the base
address that the linux kernel for that architecture will start giving
out addresses. so when running Linux on an x86 system, the first
mmap() a process does will start at 0x80000000 and move up.
although looking at the elfload code quickly, it doesnt seem that this
is really used anymore. so it probably can be ignored.
Uhmm that makes sense and explains many things like why they can simply
consider always possible that the target is allocated at
elf_ppnt->p_vaddr, without risking it to clash with qemu-user code..
Inside load_elf_binary the call to mmap has elf_ppnt->p_vaddr as required
starting address (plus alignment) and MAP_FIXED flag.
review the mmap() man page ... MAP_FIXED is always a *suggestion* and
never a requirement. the app must check the return value to see what
the kernel actually gave it.
Sorry, wrong!
*MAP_FIXED*
Don't interpret/addr/ as a hint: place the mapping at exactly
that
address. [] If the specified address cannot be used,*mmap*() will
fail.[]
http://www.kernel.org/doc/man-pages/online/pages/man2/mmap.2.html
Thank you!
Best regards!
Stefano B.