simple C file:
#include <stdio.h>
int main(){
printf("Hello World");
return 0;
}
after compile the code, using readelf -a a.out
, elf info is follow:
Questions:
- several sections appear in different segments, like interp section both in 2nd and 3rd segment. how can a section appear in more than one segments?
- the 2nd segment's address is from 0x8048134 but 3rd LOAD segment starts from 0x8048000 with 0x004d0 memsize. then the two segment overlap? How can two segments overlap in memory?
- why the program header's offset and viraddr must be congurent modulo the page size?