Question about codes in libgcc/crtstuff.c
Ian Lance Taylor
iant@google.com
Fri Nov 4 15:24:00 GMT 2016
On Fri, Nov 4, 2016 at 8:12 AM, lei wang <lei.wang.left@gmail.com> wrote:
>
> Thanks. One more question, my current entry point of the program is
> main, after which there is a call to __main to do the constructor
> stuffs and register destructors. Without INVOKE__main, which point
> should I define as the entry?
You should write some startup code that runs all the constructors in
.init_array, does any other required initialization, and then jumps to
main. The program's entry point should be that startup code. You can
name it anything you like; typical favorites are _init and _start.
You may want to look at libgloss, which is parallel to newlib, for
various examples.
Ian
More information about the Gcc
mailing list