This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: More on entry point option for ld
- To: Richard Henderson <rth at redhat dot com>, Fergus Henderson <fjh at cs dot mu dot oz dot au>, Jeff Parker <JEFFREY dot H dot PARKER at saic dot com>, gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Subject: Re: More on entry point option for ld
- From: Carlo Wood <carlo at alinoe dot com>
- Date: Sat, 30 Jun 2001 17:22:02 +0200
- References: <3B3C9591.A221F6BF@mtg.saic.com> <20010630012651.B10591@hg.cs.mu.oz.au> <20010629182805.A12402@alinoe.com> <20010629101300.B17545@redhat.com>
On Fri, Jun 29, 2001 at 10:13:00AM -0700, Richard Henderson wrote:
> On Fri, Jun 29, 2001 at 06:28:05PM +0200, Carlo Wood wrote:
> > And what if you want to do initialization of a shared library
> > *after* initialization of libc and libstdc++ but *before*
> > any constructor of global objects of other libraries (or the
> > main program) are called?
>
> You're screwed. Shared library initialization happens *before*
> any code from the application is run at all.
>
> You can get sort of close with an LD_PRELOAD library that runs
> your initialization code from a constructor.
The initialization is part of a shared library to begin with.
But that doesn't help me, because libstdc++ is initialized first
and that calls malloc() these days :/.
--
Carlo Wood <carlo@alinoe.com>