From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin v. Loewis" To: jbuck@Synopsys.COM Cc: slouken@devolution.com, hjl@lucon.org, slouken@devolution.com, egcs@egcs.cygnus.com, mindbender@lokigames.com Subject: Re: Large code size? Date: Wed, 31 Mar 1999 23:46:00 -0000 Message-ID: <199903250718.IAA00716@mira.isdn.cs.tu-berlin.de> References: <199903242353.PAA02719@atrus.synopsys.com> X-SW-Source: 1999-03n/msg00802.html Message-ID: <19990331234600.HPnvldWUpydLihe_HK0AF3nwvAStvK0h6SRQrujSESY@z> > 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