On Fri, Nov 4, 2016 at 8:12 AM, lei wang <lei.wang.l...@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