On 12/14/2011 2:17 AM, Martin Nowak wrote:
If the compiler generated static constructors and destructors ala C++ that
would then be used to register the sections, that could hook into the existing
C++ support code and not require special linker scripts and special object
files.
I partly agree and will give that approach another try.
The huge drawback is that a shared library is self-contained w.r.t.
module construction, TLS and EH. When doing this on a per object base
the overhead increases with the number of linked objects and guaranteeing
ordered initialization becomes non-trivial.
Yeah, I thought of that after I posted it.