collect2 on AIX drags too many objects from archives ?
Mike Stump
mrs@apple.com
Wed Sep 27 00:14:00 GMT 2006
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.
More information about the Gcc
mailing list