On Mon, Mar 24, 2014 at 11:02 AM, Florian Weimer <fw@xxxxxxxxxxxxx> wrote: > * Ian Lance Taylor: > >> You neglected to say what machine you were running on. __main is only >> used on some platforms. In particular it is not used on GNU/Linux. > > Do you know how this behavior of collect2 is controlled? I would like > to add this to the gccint documentation. The existing documentation is at http://gcc.gnu.org/onlinedocs/gccint/Initialization.html and the following section http://gcc.gnu.org/onlinedocs/gccint/Macros-for-Initialization.html . In short, if use_collect2 is not set to yes in config.gcc, then collect2 will not generate a __main function. If use_collect2 is set to yes, but if you define LD_INIT_SWITCH, then collect2 will also not generate a call to a __main function. Ian