In a Linux "elf" file, what is the difference between p_offset and sh_offset ?

Serge Matovic matovics@yahoo.com
Sun Dec 10 21:53:00 GMT 2006


Hi to all: I'm trying to learn the details of the
linux "elf" file format, and do not quite understand
the difference between p_offset and sh_offset.
Here are some basic facts (I can provide more detailed
text and/or code samples later if anybody decides to
help):
I have a most simple "Hello world!" assembler program
(hello.s), which I can compile (hello.o), and link
(hello) and execute (./hello) and everything works as
expected.
Now I'm looking at the hello file in two ways: using
readelf, and opening hello with a hexeditor. OK, here
is the question:
For the "data" parts of the file, both p_offset and
sh_offset have the same value, but, for the "text"
parts of the file, the p_offset and sh_offset are not
the same, and that's what I do not understand, why?

Many thnks, and best regards,
serge.




 
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited



More information about the Binutils mailing list