linker script
Posted: Sat Jan 09, 2010 11:01 am
I am using gcc cross-compiler built from the tutorial on wiki. I'm using this linker script: My kernel loads fine and works, but the file is padded to 1MB mark and I don't think it is neccessary. How can i tell the linker not to pad it but put code right after elf header?
Code: Select all
ENTRY(kmain)
OUTPUT_FORMAT(elf64-x86-64)
PHDRS
{
header PT_PHDR FILEHDR PHDRS ;
load PT_LOAD ;
}
SECTIONS
{
.text :
{
code = .;
*(.text)
*(.rodata)
*(.eh_frame)
. = ALIGN(4096);
} :load
.data :
{
data = .;
*(.data)
. = ALIGN(4096);
} :load
.bss :
{
bss = .;
*(.bss)
. = ALIGN(4096);
} :load
end = .;
}
MEMORY
{
all(RWXAI) : org = 0x0100000, l = 1M
}