Aaron Cripps
07/20/2009 10:52 PM
post34143
|
I was reading through some of the libelf source code (reading code for fun and profit), and got confused about something
(quite probably something simple). In lib/elf/libelf.c:91 is the function _elf_fill() ... above that are the functions
_elf_read() and _elf_write()
In both the read and write functions there is some common code (macro anybody? ;)) that checks to see if we are at the
current offset, then if we aren't it does an lseek and updates the elf->e_curroffset field. The interesting thing is
that in _elf_fill() the offset is checked, and then lseek() is run, but the offset isn't adjusted the way it is for the
other two function calls (elf->e_curroffset = elf->e_offset+offset;)
I was wondering what I was missing here ... is there a special reason that the offset isn't adjusted for _elf_fill like
it is in _elf_read and _elf_write?
I'm also a little curious about _elf_data_destroy() ... is this a "to do?" If not, what's happening that I'm missing?
Thanks for your time. Cheers :)
-Aaron
|
|
|