I see the process image through pmap under linux:
08048000 0 4 0 r-x-- [my program]
08049000 0 4 4 rw--- [my program]
The three segments above are code, rodata and data segments, which are all aligned to the PAGESIZE(4K),but when I put the command objdump -h, the ELF headers are displayed as follows:
read-only code segment
Load off 0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12
filesz 0x00000448 memsz 0x00000448 flags r-x
read/write data segment
Load off 0x00000448 vaddr 0x08049448 paddr 0x08049448 align 2**12
filesz 0x000000e8 memsz 0x00000104 flag rw-
It is said in the ELF header, code segment and data segment are addressed from 0x08048000,0x049448 in virtual address seperately, which is different from the process image in memory. I know the code/data segment should be assigned to different PAGESIZE,which can give them different protection permissions. However, how can the program execute if the real virtual is different from the elf binary?