LOAD segment in ELF
Posted: Wed Apr 09, 2014 2:33 pm
The second PT_LOAD segment that's the .data + .bss (assume it's the order of sections) sections "together". sizes p_filesiz and p_memsiz are requested and the kernel is up to allocate p_memsiz bytes and zero the difference between p_memsiz and p_filesiz ie., and N is the .bss memory region now filled by zeroes. How does this allocation actually works? the kernel allocate p_memsiz and put the begging of this block memory on p_vaddr so that the write/read memory region of this segment is from p_vaddr up to p_vaddr + p_memsiz ? I hope it's clear.
Code: Select all
N = p_memsiz - p_filesiz