https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81004
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org --- Comment #18 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Let me try to understand the problem. In .res file we have: 328 e6522ac3d089e792 PREVAILING_DEF _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev 333 e6522ac3d089e792 PREVAILING_DEF_IRONLY _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev We end up privatizing _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev and keep _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev external. This seems correct but for some reason we do not emit .globl at the time we produce the alias. This is because TREE_PUBLIC of alias->decl is not set. Wonder why that happens. do_assemble_alias contains: /* Make name accessible from other files, if appropriate. */ if (TREE_PUBLIC (decl) || TREE_PUBLIC (orig_decl)) { globalize_decl (decl); maybe_assemble_visibility (decl); } which looks like it is impossible to produce non-public alias of public symbol that looks quite wrong (we do make use of local aliases to public symbols and we do not want those exported). Perhaps we never realy set TREE_PUBLIC of those aliases as expected?