OSDev.org
http://forum.osdev.org/

linker script for elf64 kernel
http://forum.osdev.org/viewtopic.php?f=13&t=30959
Page 1 of 1

Author:  teodori [ Thu Oct 27, 2016 10:24 am ]
Post subject:  linker script for elf64 kernel

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.

Author:  dchapiesky [ Wed Dec 28, 2016 8:21 pm ]
Post subject:  Re: linker script for elf64 kernel

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....

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/