I have a .asm-file and a .c-file...
I assemble the .asm-file like this:
nasm -f elf boot.asm
Ok, I also have a linker file (link.ld).
First line is:
OUPUT_FORMAT("elf32-i386")
Ok, when I want to link it, ld sais:
"ld: gipp: Not enough room for program headers, try linking with -N
ld: final link failed: Bad value"
When I change the nasm command line to:
nasm -f aout ....
and change the linker file to
OUTPUT_FORMAT("binary")
everything works fine. But GRUB cannot load this...
So whats wrong with elf?
Problems when linking kernel to elf
Re:Problems when linking kernel to elf
Post your link.ld file. We can't tell you why ld doesn't like it, if we can't see it.
Re:Problems when linking kernel to elf
Ok, here it is:
OUTPUT_FORMAT("elf32-i386")
ENTRY(start)
SECTIONS
{
.text 0x1000000 : {
*(.text)
}
.data : {
*(.data)
}
.bss :
{
*(.bss)
}
}
OUTPUT_FORMAT("elf32-i386")
ENTRY(start)
SECTIONS
{
.text 0x1000000 : {
*(.text)
}
.data : {
*(.data)
}
.bss :
{
*(.bss)
}
}
Re:Problems when linking kernel to elf
I don't see anything obviously wrong with the link file. What command-line are you using for compiling the .c file and for the link step?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Problems when linking kernel to elf
just a question, are you using DjGPP (dos) or Linux gcc ?