Page 1 of 1

Section header offset not correct in grub?

Posted: Thu Oct 27, 2011 3:09 pm
by Jezze
I tried searching the forum but couldn't find an answer.

I've written a parser that parses the multiboot header for elf information. I've managed to get the elf section headers and they seem fine. My problem is that in the section header for .strtab and .symtab there is an offset that should tell me where in memory the string table and symbol table should be but this does not seem to be correct.

1. Does grub not load the content these offsets are pointing to? (i.e. the string and symbol table?)
2. The offset is supposed to be from the elf main header but grub only gives me section headers so how do I know what to base the offset from?

Re: Section header offset not correct in grub?

Posted: Thu Oct 27, 2011 4:52 pm
by Combuster
An ELF loader will not load sections that haven't been marked as such. On a typical application run, the relocations, symbols, and debugging info has absolutely no need to be visible to the application, and hence does not get marked as needed in memory.