This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: collect2 on AIX drags too many objects from archives ?
- From: Mike Stump <mrs at apple dot com>
- To: Olivier Hainque <hainque at adacore dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 26 Sep 2006 15:08:59 -0700
- Subject: Re: collect2 on AIX drags too many objects from archives ?
- References: <20060926093658.GA2378@cardhu.act-europe.fr>
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.