Linker Starting Address
Posted: Fri Apr 22, 2011 10:48 am
I cant seem to figure out why my linker is setting my base address to something seemingly random (but the same for each link). Im using the C Bare Bones linker script seen below, but when I print out the address of my kmain function, its 0x80480C1. Looking at the ELF header, the entry point is in the same range.
What can I do to it to make it so GRUB will load the kernel image at 0x100000? I have an i686-elf cross compiler\binutils setup and am using that to compile\link everything. Linker options are the same as the C Bare Bones tutorial as well (just a couple extra object files).
What can I do to it to make it so GRUB will load the kernel image at 0x100000? I have an i686-elf cross compiler\binutils setup and am using that to compile\link everything. Linker options are the same as the C Bare Bones tutorial as well (just a couple extra object files).
Code: Select all
ENTRY (loader)
SECTIONS{
. = 0x00100000;
.text :{
*(.text)
}
.rodata ALIGN (0x1000) : {
*(.rodata)
}
.data ALIGN (0x1000) : {
*(.data)
}
.bss : {
sbss = .;
*(COMMON)
*(.bss)
ebss = .;
}
}