crt0.o and _start symbol

Ian Lance Taylor iant@google.com
Fri Sep 11 15:11:00 GMT 2009


Bahadir Balban <bahadir.balban@gmail.com> writes:

> I am compiling a program with GCC using the -nostdlib and
> -ffreestanding flags, and linking it against a C library. I am also
> compiling the C library using GCC.
>
> The problem is that even though I link the C library with crt0.o file,
> and confirm that _start symbol is also there in the libc.a archive,
> When I link the program against the C library, it complains about not
> finding _start symbol.
>
> If I explicitly include crt0.o in the program link, then it works OK.
> Any reason why I can't get this symbol by directly linking with the C
> library archive?

This is a question about the GNU binutils, not about gcc.  I recommend
taking any followup to binutils@sourceware.org.  See
http://sourceware.org/binutils/ .

The answer is that -e does not imply -u, although that is likely to
change in the next binutils release.  Most systems link against crt0.o
explicitly.

Ian



More information about the Gcc-help mailing list