Re: Controlling ld and as with GCC-Backend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013/3/17 Jens Mehler <jens.mehler@xxxxxxxxxx>:
> Hi,
>
> the problem I keep running into is something that I don't fully
> understand (yet).
> I wrote a new backend for GCC, ported the GNU-Toolchain to my target and
> got it running.
>
> The next thing I did:
> I wrote a small helloworld.c a start.s and an end.s.
> Everything that is needed is included in those files. When building the
> program myself:
> eco32-elf-gcc -S helloworld.c
> eco32-elf-as -o hello.o start.s helloworld.s end.s
> eco32-elf-ld -o hello.elf hello.o
> everything works like a charm. The program even runs in the simulator
> (after using eco32-elf-objdump -O binary hello.elf hello.bin)
>
> After that I tried using only gcc:
> gcc -o hello.elf start.s helloworld.c end.s
> after that I got "ld can't find crt0.o".

Hi Jens,

It is controlled by spec mechanism.
The following is the link for its syntax:
http://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html

In your case, I think you should define your own
STARTFILE_SPEC and ENDFILE_SPEC to guide gcc driver
using start.o and end.o files.


Best regards,
jasonwucj


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux