On Apr 25, 3:32 pm, Paul Pluzhnikov <[EMAIL PROTECTED]> wrote: > Michael Kilburn <[EMAIL PROTECTED]> writes: > > And indeed executable size was decreased to ~32Mb. But still it is > > wrong -- I have created simple application that just calls empty > > function from one of these libraries: > > int main() > > { > > foo(); // foo's body is empty > > } > > > resulting image size was ~17Mb. If you comment out this call image > > size = 5kb. > > If the file that was pulled in (the one defining empty foo()), > contains any global objects, then the constructors for such objects > are pulled in, anything that these constructors reference is pulled > in, etc. etc.
I thought about it... 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. In this case, since foo() does not reference anything -- the rest should be thrown away. There is another suggestion -- maybe referencing something from static library (*.a) brings in all static variables (and their dependencies), but even then they should be thrown away -- simply because their trees of references are isolated from our stuff (references tree derived from entry-point function). :-( Bye. Sincerely yours, Michael. _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus