This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]