I compile my code for sparc embedded platform using gcc with the -nostartfiles and -nostdlib The command as follows:
gcc -Tlinkram usr.o bspstart.o -o output.elf
The output elf file is wrong , because the code on the address 0x2000000 is from usr.o, but i expect this bspstart.o.
In bspstart.s, the entry symbol is start
I try to solve the problem in several ways:
- reorder the bspstart.o and usr.o in gcc command argments, it works
- I specify entry symbol by using ld args, -e start, it dosen't work
I wonder except manually specify the order of object file in gcc command, is there anyway to specify the startup code?