Thanks a lot for your patience, I got a little bit further regarding the sections, so I want to show you what I researched and what now works:
I can now display all sections with their virtual address as well as their physical address. One point though, you said:
iansjack wrote:Relocate it to it's desired place in memory (which would be 0x200000 as things stand, since that's what you told the linker).
As you can see in the following picture, the 0x200000 is the offset from the elf64 file header to the section, not the actual physical address.
Clearing this mistake let me dump the sections along with their informations:
https://imageshack.com/a/img923/5238/Fdi3uy.png
As you can see, the output in my OS matches the values from objdump. Now I wanted to check if the physical addresses are also correct, so I memdumped the physical memory and got the following screen:
https://imageshack.com/a/img924/3290/cyRlI1.png
Here you see the bochs emulator on the left, dumping the physical memory at start address 0x31F000, which is mapped through 0xffffffff80200000. This is the start of the .text section in the elf file. On the right you see the sublime text editor with the disassembled elf file of the kernel and you can compare the bochs memdump and the disassembled file: The bytes match perfectly, meaning this is where the sections are loaded.
In this case, what would be my next step? So far I only retrieved all the informations regarding the sections and segments dynamically.
The code seems to be in the memory as well, so the only thing left would be mapping the virtual addresses to the physical addresses of the individual sections of the elf files with the specified size, right?
PS: What about the .symtab, .strtab and .shstrtab section though? Those three aren't listed in objdump but only in my OS.