http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601

--- Comment #32 from Cesar Strauss <cestrauss at gmail dot com> 2010-09-28 
00:16:48 UTC ---
(In reply to comment #31)
> This is somewhat off topic but unfortunately (MinGW) c++filt doesn't work for
> me, e.g.:
> 
> % echo '.text$_ZNK17wxMBConvUTF16Base11GetMBNulLenEv'|/mingw/bin/c++filt.exe
> .text$_ZNK17wxMBConvUTF16Base11GetMBNulLenEv

Try echo '__ZNK17wxMBConvUTF16Base11GetMBNulLenEv'|/mingw/bin/c++filt.exe
Anyway, look at the end of each line of objdump -h <object> | c++filt, where it
says 'COMDAT <name of method>'. 

> > Why there is one section for each emitted inline method?
> 
> Excellent question which I'm unfortunately totally unable to answer.

When two or more source files include the same header, the exported inline
functions end up duplicated in both object files. When linking these objects
together in the final DLL, the linker would give an error because of the
multiple definitions. To avoid this, each exported inline function is placed in
a separate section, identified by the COMDAT name. When the linker sees two or
more sections with the same COMDAT name, it can safely keep one of them and
discard the rest.

Reply via email to