Question about codes in libgcc/crtstuff.c
Ian Lance Taylor
iant@google.com
Fri Nov 4 15:06:00 GMT 2016
On Fri, Nov 4, 2016 at 7:55 AM, lei wang <lei.wang.left@gmail.com> wrote:
>
> In fact, I just want to find a practical way to make the crt work.
> Currently, I did the following configure in my port:
>
> include "elfos.h" in tm.h
> define HAS_INIT_SECTION
> undefine OBJECT_FORMAT_ELF
> define INVOKE__main
> use default INIT_SECTION_OP
>
> My port is working on a bare metal machine with newlib support. Seems
> I fall into an spurious configure for compiling crtstuff.c. Could you
> give me some guide to lead me back to common configuration of this?
If you are using ELF, arrange for your startup code to execute the
functions in the .init_array section. If necessary, modify your
linker script to define symbols around .init_array that your startup
code can use to find the section. Pass --enable-initfini-array when
you run configure. Don't define INVOKE__main. Don't worry about
HAS_INIT_SECTION or OBJECT_FORMAT_ELF or INIT_SECTION_OP.
Ian
More information about the Gcc
mailing list