Strange GCC behavior...
Posted: Fri Oct 09, 2015 10:36 am
I have just built a cross-compiler for building my OS (Was previously using fasm) and I have noticed that GCC doesn't seem to like my linker.ld file. I am using GCC version 4.1.1, with binutils version 2.16.1.
The part of linker.ld GCC stumbles on:
The message from GCC (I have a makefile set up so this is what happens after the 'make kernel' command is given):
The part of linker.ld GCC stumbles on:
Code: Select all
.text BLOCK(4K) : ALIGN(4K)
{
*(.multiboot)
*(.text)
}
What have I done wrong, I don't see anything that should cause a parse error? Edit: I think my syntax is correct, could it possibly be a problem with binutils?/usr/local/cross/i686-elf/bin/gcc -c kernel.c -o kernel.o -std=gnu99 -O2 -Wall -Wextra -ffreestanding
/usr/local/cross/i686-elf/bin/as boot.s -o boot.o
/usr/local/cross/i686-elf/bin/gcc -T linker.ld -o myos.bin -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc
/usr/local/cross/lib/gcc/i686-elf/4.1.1/../../../../i686-elf/bin/ld:linker.ld:16: parse error
collect2: ld returned 1 exit status
make: *** [kernel] Error 1