This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Large code size?


> Hmm.  Does the gnu.linkonce trick work for shared libraries?

Yes, it does:

mira% g++ -c -fPIC -ftemplate-depth-110  a.cc
mira% size a.o
   text    data     bss     dec     hex filename
 128446    9656       1  138103   21b77 a.o
mira% g++ -c -fPIC -ftemplate-depth-110  b.cc
mira% size a.o                               
   text    data     bss     dec     hex filename
 128446    9656       1  138103   21b77 a.o
mira% g++ -shared -o a.so a.o b.o 
mira% size a.so
   text    data     bss     dec     hex filename
 153487   20756      32  174275   2a8c3 a.so

What doesn't work: you can't eliminate template instantiations from a
shared library in the final link of the program.

Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]