On Friday 30 May 2008 13:22:15 Diego 'Flameeyes' Pettenò wrote:
> The only thing that can be broken by using --as-needed is code that
> assumes the order in calling the .init sections of a set of shared
> objects. Such an order is not only changed by --as-needed usage but by
> any other change in the loading mechanism. It is strictly related to
> glibc at this point as far as I can tell.

It's not just the order, it also breaks things that rely on the .init section 
being called at all to register themselves with the core application 
(with --as-needed, the .so doesn't get loaded in the first place, so it 
doesn't get a chance to run anything).

> It's interesting to note that Microsoft _did_ think of this problem when
> designing the .NET framework, and they answer is ensuring just that the
> static constructor will be called (right) before any static method or
> attribute is referenced and (right) before any object of the given class
> is istantiated. They don't get otherwise an absolute order in which
> static constructors are called.

That's /an/ answer, but it doesn't provide all the functionality that static 
objects in C++ have.
--
gentoo-dev@lists.gentoo.org mailing list

Reply via email to