The future of __main (was Re: __main call for c++ on sparc-elf target)

Chris Lattner sabre@nondot.org
Thu Jun 26 18:41:00 GMT 2003


On 26 Jun 2003, Jim Wilson wrote:
> Some of your criticisms of init/fini are fixed by the follow on
> init_array/fini_array ELF sections.  init/fini contain code, but
> init_array/fini_array are just lists of function addresses.  They are
> similar to the ctor/dtor lists we have now, except that the code that
> runs them is now in the loader instead of in the program.  I think that
> solves most of your size problem.  It also makes them more transparent
> to a whole program optimizer.  See the ELF standard for more info.

Interesting: this sounds exactly like what we are doing in LLVM (building
arrays of function address/priority pairs, instead of code).  I wasn't
aware of this work, I'll definately take a look!

Thanks!

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/



More information about the Gcc mailing list