At what offset does grub load the elf file?

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
tabz
Member
Member
Posts: 35
Joined: Fri Apr 20, 2018 9:15 am
Location: Cambridge, UK

At what offset does grub load the elf file?

Post by tabz »

I would like to read the debug sections from my kernel elf file and therefore need to know at what memory address grub loads the elf file so I can add it to the sections' offset. Is there a way to find out at what address the entire elf file was loaded?
klange
Member
Member
Posts: 679
Joined: Wed Mar 30, 2011 12:31 am
Libera.chat IRC: klange
Discord: klange

Re: At what offset does grub load the elf file?

Post by klange »

Grub does not load the entire ELF.

You need to make sure your debug sections are marked for loading when you link your ELF and possibly add some symbols around them so you can find out where they are.
tabz
Member
Member
Posts: 35
Joined: Fri Apr 20, 2018 9:15 am
Location: Cambridge, UK

Re: At what offset does grub load the elf file?

Post by tabz »

klange wrote:You need to make sure your debug sections are marked for loading when you link your ELF
How would I do so?
klange wrote:and possibly add some symbols around them so you can find out where they are.
I tried that but ran into this issue.
Post Reply