never-used inlines becoming statics

Todd Vierling tv@pobox.com
Sat Sep 5 19:41:00 GMT 1998


On Sat, 5 Sep 1998, Todd Vierling wrote:
: : So I can see exactly one static symbol, gcc2_compiled. This is
: : intentional and not a bug. The other symbols are all weak: If you link
: : the program, duplicates of them will be removed (at least on my
: : system).

: You're reproducing the problem, just that your linker can partially cope by
: the use of weak symbols.

Let me correct myself - which drives the point home more bluntly to Linux
users.

Weak symbols do _not_ remove common code - they allow an alternative
entry point for a given symbol.  All this excess code generated by my
testcase will be used several times over in a resultant executable, even
though only one copy gets _used_ because of the weak symbols.

Now, if -fexternal-templates worked and didn't bomb out on bastring.cc, I'd
have some hope of using explicit instantiation.  But that's a bug for
another report.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)




More information about the Gcc-bugs mailing list