I'm debugging php. When looking at a place in memory where I know a pointer to an address is, I see the pointer - for example 22810408 (0x08048122) - this is when using the CLI version of php.
HOWEVER, when I'm using apache2 and attempting to do the same thing, I don't see a pointer to the real address. Instead, I see an offset from the ELF header that when added to the address of the ELF header, gives me the "real" address. For example, if the "real" address was 0x08048122, and the ELF header was at 0x08048000 then I would see 22010000 (0x122) at this same position.
The problem arises when I try to figure out the "real" address of something that is on the stack. The "real" address is supposed to be 0xbfccxxxx, but when adding the number I find to the ELF header, things just don't add up! I get all the wrong addresses.
I've already tried googling for a long time, but I am really not sure how to word this correctly, or what to search for.
So, what I'm essentially looking for is more information on WHY Apache has an offset instead of a real memory address, and how this all relates to addresses on the stack. Could anyone give me any pointers to material that might clarify?