Rémi Cardona <[EMAIL PROTECTED]> writes:

> --as-needed breaks legitimate C++ code, I have yet to see it break
> plain C code (but I could be wrong).

This because C does not have constructors or static objects. I suppose I
can write a couple of C files that can present the problem, but really,
they would break as soon as I change the loading rules by moving to a
non-ELF system or a different dynamic loader.

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.

-- 
Diego "Flameeyes" Pettenò
http://blog.flameeyes.eu/

Attachment: pgp6Q7c1XvJEy.pgp
Description: PGP signature

Reply via email to