Building a uclibc based toolchain
WANG.Jiong
wong.kwongyuan at gmail.com
Thu Oct 27 11:22:42 UTC 2011
On 10/27/2011 04:27 PM, stl wrote:
>
> Ok. These function seems to be declared but not defined.
> Why are these functions used?
they are used for exception handling.
> In my uclibc port, I have a crt0.c startup file which contains
> '_start' entry symbol.
> It was working fine with my port of uClinux.
> Now, a crt1.c or crt1.S seem to be expected.
>
> What is the difference between crt0.c and crt1.c ?
crt1.c is with constructors/destructors support, while crt0.c is not
from my opinion, there is no difference, it all depends on your
implementation. Pass the address of ctor/dtor "_init" and "_fini" to
__uClibc_main, then __uClibc_main will decide whether to run them by the
macro __UCLIBC_CTOR_DTOR__.
Normally, you need to generate crt1.o, because gcc expects this
name, you can "gcc -dumpspecs", and check what startfile section shows,
like:
gcc -dumpspecs | grep crt
> Should I define 'start' or '_start' into my startup code?
it's just a symbol to mark the entry point, I think it depends on
your linker port, for example,
x86 use _start while mips use __start
ld -verbose | grep ENTRY
ENTRY(_start)
mips-linux-gnu-ld -verbose | grep ENTRY
ENTRY(__start)
> Thanks in advance for your help.
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc
More information about the uClibc
mailing list