Generalized init_priority attribute

Aaron W. LaFramboise aaronavay62@aaronwl.com
Mon Nov 29 00:14:00 GMT 2004


Hi,

Could someone explain to me the need for specialized .jcr handling?

With regards to initialization, from a forward-looking perspective, GCC
on Windows could support any sort of static initialization mechanism it
wanted, as changes to any of the corresponding support code is easy to make.

I think its undesirable to proliferate new initialization mechanisms any
more than necessary.  Ideally, a single 'one best' mechanism could be
decided upon, such as the one thats the most efficient and robust and
compatible, and all other mechanisms could be deprecated.  Is there a
'best' mechanism, and if so, what is it?

For what its worth, the primary vendor Windows compiler has its own
initialization mechanism, also relying on PECOFF-mandated link-time
section sorting for priority.  It breaks initialization into several
catagories: C initialization, C++ initialization, pre-termination,
termination, and TLS-notification, each with infinite sub-priorites.
Mainline GNU ld supports it, but mingwrt and Cygwin so far do not.
Perhaps GCC on Windows should transition in this direction?

Also, I don't feel very sorry for users who get unfavorable
initialization order because they knowingly circumvented the
init_priority system with asm().

Aaron W. LaFramboise



More information about the Gcc-patches mailing list