This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: collect2 on AIX drags too many objects from archives ?


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]