http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54791
--- Comment #17 from Adi <adivilceanu at yahoo dot com> 2012-11-07 14:45:59 UTC
---
Finally I got it working. You are right, there are _GLOBAL* symbols generated
for each constructor, but only when you specify the init_priority attr for
that object. (otherwise there is just on _GLOBAL per file).
Also init_priority did not work previously on my side because of how I put it
in the code: "ClassName objName("some string") __attribute__ ((init_priority
(NNNN)));
I realized that I need to put the _attribute_ between the objName and ("some
string").
So now my whole project works with static libs.
Do you know what I can do for shared libs?
Can I take advantage of the -binitfini option on the lib to somehow set a
priority for the hole lib? I need a lib to initialize before the main exe gets
initialized.
Thanks !