https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103490

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The bug is definitely on the clang side. GCC is following the ABI to letter of
having all vtables in comdat.



  if (CGM.supportsCOMDAT() && VTable->isWeakForLinker())
    VTable->setComdat(CGM.getModule().getOrInsertComdat(VTable->getName()));

Should not check isWeakForLinker. All vtable needs to be comdat:
They are emitted in a COMDAT group, with the virtual table mangled name as the
identifying symbol.


This is also true for RTTI even:
The RTTI std::type_info structures for complete class types and basic types are
emitted in COMDAT groups identified by their mangled names.

Reply via email to