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

--- Comment #13 from roland at gnu dot org ---
(In reply to Jakub Jelinek from comment #7)
> (In reply to Jonathan Wakely from comment #6)
> > OK.
> > 
> > FWIW Clang seems to create two different sections called foo, one COMDAT and
> > one not.
> 
> Does it?  That is I think impossible unless bypassing assembler.
> If I try godbolt and look at clang++ trunk generated assembly, it doesn't
> honor the user sections at all, whether using inline vars or not.

Please see bug 116184 for a related case where neither Clang's assembler nor
(at least current) GAS is an impediment to fixing the GCC bug.  Both assemblers
fully support two sections in different COMDAT groups that have the same
section name.  (Obviously, as this is the normal case for .rodata et al from
C++ template instantiations.)

GCC has the bug that it doesn't emit the correct `.section` directives when the
section attribute is used, as fully demonstrated in bug 116184.  This can be
fixed in GCC and no assembler constraints prevent that working fine.

Reply via email to