Page 1 of 1

linker script for elf64 kernel

Posted: Thu Oct 27, 2016 10:24 am
by teodori
Hello I have written my own kernel loader, but I am having problems to setup the right gnu ld script. I want my program that way:
.text VMA(0x00000000) LMA(0x00100000)
.rodata (just behind .text and vma & lma aligned to size)
.data (just behind .rodata and vma & lma aligned to size)
.bss (just behind .data and vma & lma aligned to size)

As soon as I am home I will post my linker script.

Re: linker script for elf64 kernel

Posted: Wed Dec 28, 2016 8:21 pm
by dchapiesky
Are you using an elf loader or objcopy'ing to a binary?

see http://wiki.osdev.org/Linker_Scripts

but know that binary format (i.e. no elf loader - just load in memory and jmp) ignores ENTRY()... you must make sure your startup code in at the address you want....