1 |
Rémi Cardona <remi@g.o> writes: |
2 |
|
3 |
> --as-needed breaks legitimate C++ code, I have yet to see it break |
4 |
> plain C code (but I could be wrong). |
5 |
|
6 |
This because C does not have constructors or static objects. I suppose I |
7 |
can write a couple of C files that can present the problem, but really, |
8 |
they would break as soon as I change the loading rules by moving to a |
9 |
non-ELF system or a different dynamic loader. |
10 |
|
11 |
It's interesting to note that Microsoft _did_ think of this problem when |
12 |
designing the .NET framework, and they answer is ensuring just that the |
13 |
static constructor will be called (right) before any static method or |
14 |
attribute is referenced and (right) before any object of the given class |
15 |
is istantiated. They don't get otherwise an absolute order in which |
16 |
static constructors are called. |
17 |
|
18 |
-- |
19 |
Diego "Flameeyes" Pettenò |
20 |
http://blog.flameeyes.eu/ |