http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54095
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-26 14:48:36 UTC --- Created attachment 27879 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27879 incomplete prototype patch Something like this. But I'll rather wait for the symtab reorg to reach cgraph/varpool_node_set (and for the partitioning rewrite to go in). The patch simply, at current lto_promote_cross_file_statics time (which can still alter the sets), does the mangling of statics. Which means it works at WPA time and thus will not work with -flto-partition=none. LTRANS file generation is confused because of conflicting section names if we try to postpone it to LTRANS phase. For -flto-partition=none we need a "simpler" hack elsewhere.