Section header offset not correct in grub?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Jezze
Member
Member
Posts: 395
Joined: Thu Jul 26, 2007 1:53 am
Libera.chat IRC: jfu
Contact:

Section header offset not correct in grub?

Post 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?
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Section header offset not correct in grub?

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply