Hello,
I made ARM-ELF compiler. I tryed simple source to compile:
int main()
{ while (1);
}
I compiled it to make ASM code with following line:
arm-elf-gcc -o test.asm -S test1.c
And short ASM code was :
...
main: @ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, current_function_anonymous_args = 0
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
bl __gccmain
.L2: b .L2
.Lfe1: .size main,.Lfe1-main
But after:
arm-elf-as -o test.o test.asm
arm-elf-ld -o test.bin -e main test.o
I got error: test.o<.text+0xc>: undefined reference to '__gccmain'
What to do, that GCC would not generate __gccmain reference? Or how
to solve it, that linker would understand it?
After removing this reference manualy (from ASM file), linker
worked. But I hope exists better solutions...
My used GCC version is 3.0
Thanks in advance.
------------
Best regards,
Dainius Zilys