Understanding Linker Error-Output Format
Posted: Sun Dec 20, 2009 9:09 pm
Geez, it's always the "simple" stuff.... Well, I've decided to move my kernel to 64 bit but have run into a slight problem when linking.
What confuses me, is that to my knowledge I am not trying to output i386. I'm using this as my linker script trying to follow the 64 bit kernel tutorial:
(The important part at the top.)
When I compiling I am also using nasm's elf64 and gcc's -m64 options, so can somebody please explain what I am misunderstanding here?
Code: Select all
ld: i386:x86-64 architecture of input file `bootstrap.o' is incompatible with i386 output
ld: i386:x86-64 architecture of input file `kernel.o' is incompatible with i386 output
Code: Select all
OUTPUT_FORMAT(elf64-x86-64)
ENTRY(bootstrap)
SECTIONS{
. = 0x00100000;
KSTART = .;
.bootstrap :{
bootstrap.o(.text)
}
END_BOOTSTRAP =.;
.text :{
*(.text)
}
END_TEXT =.;
.rodata ALIGN (0x1000) : {
*(.rodata)
}
END_RODATA =.;
.data ALIGN (0x1000) : {
*(.data)
}
END_DATA = .;
.bss : {
sbss = .;
*(COMMON)
*(.bss)
ebss = .;
}
END_BSS =.;
KERNEL_END = .;
}
When I compiling I am also using nasm's elf64 and gcc's -m64 options, so can somebody please explain what I am misunderstanding here?