<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Linkers part 15</title>
	<atom:link href="http://www.airs.com/blog/archives/52/feed" rel="self" type="application/rss+xml" />
	<link>http://www.airs.com/blog/archives/52</link>
	<description>Ian Lance Taylor</description>
	<lastBuildDate>Mon, 26 Jul 2010 08:38:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Joe Buck</title>
		<link>http://www.airs.com/blog/archives/52/comment-page-1#comment-5020</link>
		<dc:creator>Joe Buck</dc:creator>
		<pubDate>Tue, 09 Oct 2007 04:04:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.airs.com/blog/archives/52#comment-5020</guid>
		<description>There&#039;s another related feature of most C++ implementations, invented by Stroustrup (or one of his colleagues), used also by g++. Rather than emitting the virtual function table definition in every object file and using COMDAT, it is emitted in the .o file that contains the definition of the first non-inline virtual function. By the one-definition rule there must be only one such file; doing it this way saves considerable space in .o files. COMDAT is used if all of the functions are defined inline or in the class definition. The typeinfo object for the class is handled in the same way, as are &quot;out-of-line&quot; definitions for virtual functions that are inline.

This optimization sometimes leads to confusing messages from the linker if there is a missing definition for this first virtual function. I recall that Sun&#039;s linker would generate a message saying something like

virtual function table for class Foo is undefined
[ hint: see if the first non-inline virtual function of Foo is defined ]

while the GNU linker only gave the first message (or would complain about a missing typeinfo object).</description>
		<content:encoded><![CDATA[<p>There&#8217;s another related feature of most C++ implementations, invented by Stroustrup (or one of his colleagues), used also by g++. Rather than emitting the virtual function table definition in every object file and using COMDAT, it is emitted in the .o file that contains the definition of the first non-inline virtual function. By the one-definition rule there must be only one such file; doing it this way saves considerable space in .o files. COMDAT is used if all of the functions are defined inline or in the class definition. The typeinfo object for the class is handled in the same way, as are &#8220;out-of-line&#8221; definitions for virtual functions that are inline.</p>
<p>This optimization sometimes leads to confusing messages from the linker if there is a missing definition for this first virtual function. I recall that Sun&#8217;s linker would generate a message saying something like</p>
<p>virtual function table for class Foo is undefined<br />
[ hint: see if the first non-inline virtual function of Foo is defined ]</p>
<p>while the GNU linker only gave the first message (or would complain about a missing typeinfo object).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tromey</title>
		<link>http://www.airs.com/blog/archives/52/comment-page-1#comment-4549</link>
		<dc:creator>tromey</dc:creator>
		<pubDate>Thu, 20 Sep 2007 20:36:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.airs.com/blog/archives/52#comment-4549</guid>
		<description>FWIW, for the compile server I&#039;m looking into a repository-like approach for things that would ordinarily have vague linkage.  Or, perhaps I&#039;ll generate them once and then link each into the object files requested by the compilation job.  The latter approach may be somewhat slower but has the benefit of creating objects with the expected contents.

Luckily all this is a ways off, so I don&#039;t have to make any hard decisions soon.</description>
		<content:encoded><![CDATA[<p>FWIW, for the compile server I&#8217;m looking into a repository-like approach for things that would ordinarily have vague linkage.  Or, perhaps I&#8217;ll generate them once and then link each into the object files requested by the compilation job.  The latter approach may be somewhat slower but has the benefit of creating objects with the expected contents.</p>
<p>Luckily all this is a ways off, so I don&#8217;t have to make any hard decisions soon.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
