This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about codes in libgcc/crtstuff.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]