I met a problem on ldscript.
Posted: Tue Apr 18, 2006 6:38 am
Hi all.I wrote a simple ldscript file to generate my kernel image.But as I typed the command x86_64-pc-linux-gnu-ld -T kernel.ld -o kernel.img *.o in , a list of error messages are shown. Messages are something as bellow:
relocation truncated to fit : R_X86_64_32 against '.bss'
relocation truncated to fit : R_X86_64_32S against '.bss'
Here is my simple script:
OUTPUT_FORMAT("elf64-x86-64")
ENTRY(_start_kernel_stage1)
__image_addr__ = 0xFFC000000000+12;
SECTIONS
{
.start __image_addr__ : AT( __image_addr__ )
{
*(.start)
}
.init __image_addr__ : AT( ADDR(.start) + SIZEOF(.start) )
{
init_size = .;
*(.init)
init_size = . - init_size + 12;
}
.text : AT( ADDR(.init) + SIZEOF(.init))
{
kernel_size = .;
*(.text)
*(.data)
*(.bss)
kernel_size= . -kernel_size;
}
}
I feel crazy,any help is appreciated.
hendric.
relocation truncated to fit : R_X86_64_32 against '.bss'
relocation truncated to fit : R_X86_64_32S against '.bss'
Here is my simple script:
OUTPUT_FORMAT("elf64-x86-64")
ENTRY(_start_kernel_stage1)
__image_addr__ = 0xFFC000000000+12;
SECTIONS
{
.start __image_addr__ : AT( __image_addr__ )
{
*(.start)
}
.init __image_addr__ : AT( ADDR(.start) + SIZEOF(.start) )
{
init_size = .;
*(.init)
init_size = . - init_size + 12;
}
.text : AT( ADDR(.init) + SIZEOF(.init))
{
kernel_size = .;
*(.text)
*(.data)
*(.bss)
kernel_size= . -kernel_size;
}
}
I feel crazy,any help is appreciated.
hendric.