[PATCH] [lld][core] sectionGroup support.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Feb 27 14:10:30 PST 2014


> With gcc produces the symbols _ZN3barC1Ev and _ZN3barC2Ev for the
> actual functions, but produces a new symbol (_ZN3barC5Ev) for the
> comdat. I think this is an ABI compatibility issue. If older version
> of gcc would put each constructor in its own comdats, newer versions
> that do the optimization of defining them as alias and putting them in
> the same comdat have to use a new symbol. I will double check if that
> is the case and report back.

Yes, that was exactly what happened. From
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3187#c27:

------------------------------------------------------------------------------------
This scheme fails in the case that the constructors must go in a
comdat group. What do we name the group?  If we invent a new name,
this will have ABI impact, as other implementations must not step on
it.  If we use the name of one of the constructors, we may find that
the section is discarded in favor of a like-named section produced by
another compiler, but which need not define both symbols, resulting in
link-incompatibility.  It appears, then,
that a distinct group name must be used for the combined constructor.
----------------------------------------------------------------------------------------

Cheers,
Rafael



More information about the llvm-commits mailing list