I wrote a small program to add two integers and on using readelf -a executable_name
it showed the entry point address in elf header as:
Entry point address: 0x8048330
How does my executable know this address beforehand even before loader loads it in memory?
elf_format.pdf
says this member gives the virtual address to which the system first transfers control, thus starting the process. Can anyone please explain what is the meaning of this statement and what is the meaning of virtual address here?
Also let me know, from where the executable file gets the value of 0x8048330
as entry point address. Just for cross check I compiled another program and for that also, the entry point address remains the same value 0x8048330
(offset of .text
section being 0x330
in both the cases).