Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Aug 2004 09:16:00 -0600
From:      "Justin T. Gibbs" <gibbs@scsiguy.com>
To:        Doug Rabson <dfr@nlsystems.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: New nvidia drivers available
Message-ID:  <D5005C10BFCCF98A80A9F3D2@aslan.scsiguy.com>
In-Reply-To: <200408151611.04764.dfr@nlsystems.com>
References:  <Pine.GSO.4.43.0408151001050.15254-100000@sea.ntplx.net> <200408151553.32463.dfr@nlsystems.com> <200408151611.04764.dfr@nlsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>> I thought that static constructor invocation was deterministic based
>> on link order.  Does the C++ spec really indicate that the order of
>> construction can be random?
> 
> I don't think the spec places any restrictions on constructor ordering. 
> The problem here is that you get different behaviour depending on 
> whether you link with libGL first followed by libpthread (in that case 
> libpthread initialises first) or if you link in the other order (in 
> which case libGL initialises first). As far as I can see, rtld calls 
> the _init sections of each shared library in reverse order with the 
> last library linked against being initialised first.

But such ordering restrictions also apply to things like weak symbols,
so I don't think that imposing a link order restriction to solve
this issue is really a problem.

>From my Microsoft days, I know that at least PowerPoint took advantage
of the known order of static constructor invocation.  The splash screen
was executed from a static constructor in the first .o linked into the
executable.  I'm just curious if this is something the C++ spec says
anything about.  I'd be surprised if it didn't.

--
Justin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D5005C10BFCCF98A80A9F3D2>