Mike Stump wrote: > On Sep 26, 2006, at 2:36 AM, Olivier Hainque wrote: > > /* The AIX linker will discard static constructors in object files > > if nothing else in the file is referenced [...] */ > Darwin has this same sort of issue and solves it by not wiring up > ctors/dtors for all these things but instead have a separate > convention to register/unregister the tables, both for the statically > linked things, dlopen type things and shared library type things.
> Essentially, upon load, they wonder symbol tables (ok, actually the > section table) and register based upon what they find. See crt1.o > (Csu/crt.c) and keymgr/keymgr.c for additional hints. Will have a look, thanks for the pointer.