Michael Kilburn <[EMAIL PROTECTED]> writes:

> Yes, there are quite a few static object with
> non-trivial contructor/destructor. But, I thought that specifying
> -ffunction-sections
> -fdata-sections
> is equivalent of putting every function and static variable in a
> separate translation unit/object file.

Your experimental result clearly shows that it is *not* equivalent.

> In this case, since foo() does
> not reference anything -- the rest should be thrown away.

As I explained, the rest can't be thrown away because it is
*referenced* (but not from foo()).

> There is another suggestion -- maybe referencing something from static
> library (*.a) brings in all static variables (and their dependencies),

It doesn't. It is trivial to construct an experiment that proves this.

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to