linker script for elf64 kernel

Programming, for all ages and all languages.
Post Reply
teodori
Member
Member
Posts: 103
Joined: Wed Nov 14, 2012 4:55 pm

linker script for elf64 kernel

Post 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.
User avatar
dchapiesky
Member
Member
Posts: 204
Joined: Sun Dec 25, 2016 1:54 am
Libera.chat IRC: dchapiesky

Re: linker script for elf64 kernel

Post 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....
Plagiarize. Plagiarize. Let not one line escape thine eyes...
Post Reply