https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144
--- Comment #29 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Created attachment 33209 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33209&action=edit patch I am testing Sorry for taking so long on this issue - I had busy time and there is no really good answer to this problem. C++ require constant variables to be folded, ELF interposition interpreted in full generality prevents folding of many symbols. We behave in C++ way for years and I think it should stay a default, so I think we can special case the user specified WEAK attribute - i.e. do not give up on PIC exported symbols nor C++ COMDATs as we already special case COMDAT. I hope this won't break non-ELF targets, like AIX - will give it a try.