Re: Question about codes in libgcc/crtstuff.c

2016-11-04 Thread Ian Lance Taylor
On Fri, Nov 4, 2016 at 8:12 AM, lei wang 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 shou

Re: Question about codes in libgcc/crtstuff.c

2016-11-04 Thread lei wang
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? Lei 2016-11-04 11:06 GMT-04:00 Ian Lance Taylor : > On Fri, Nov 4

Re: Question about codes in libgcc/crtstuff.c

2016-11-04 Thread Ian Lance Taylor
On Fri, Nov 4, 2016 at 7:55 AM, lei wang 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 INI

Fwd: Question about codes in libgcc/crtstuff.c

2016-11-04 Thread lei wang
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 newl

Re: Question about codes in libgcc/crtstuff.c

2016-11-04 Thread Ian Lance Taylor
On Thu, Nov 3, 2016 at 7:20 PM, Lei Wang wrote: > The brief structure of libgcc/crtstuff.c is as follows: > > #ifdef CRT_BEGIN > … > #elif defined(CRT_END) > ... > # ifdef OBJECT_FORMAT_ELF > … > # else > > static void > __do_global_ctors_aux (void)/* prologue goes in .text section */ > { >

Question about codes in libgcc/crtstuff.c

2016-11-03 Thread Lei Wang
The brief structure of libgcc/crtstuff.c is as follows: #ifdef CRT_BEGIN … #elif defined(CRT_END) ... # ifdef OBJECT_FORMAT_ELF … # else static void __do_global_ctors_aux (void)/* prologue goes in .text section */ { asm (__LIBGCC_INIT_SECTION_ASM_OP__); DO_GLOBAL_CTORS_BODY; atexit (_