Linkonce vs comdat

Mike Stump mrs@apple.com
Tue Sep 23 00:12:00 GMT 2003


On Monday, September 22, 2003, at 03:03 PM, Matt Austern wrote:
> I'm getting confused about whether the linkonce scheme that the 
> compiler uses on ELF systems (i.e. with sections that have names like 
> .gnu.linkonce.t.foo) is supposed to be the same thing as the COMDAT 
> scheme that's described in 
> http://www.codesourcery.com/cxx-abi/abi/prop-72-comdat.html.

I've fielded this one in person...  Short answer, they are similar but 
comdat is more complete.  linkonce predates comdat's implementation in 
binutils.  binutils supports both, is used to only support linkonce.  
The compiler only does link once, though, someone will add comdat 
support and I'll probably miss it, let me know if I already missed it.



More information about the Gcc mailing list