rnk added a comment. See also https://reviews.llvm.org/D26770 / https://reviews.llvm.org/D26771, which do this for COFF. Doing it for ELF will require more investigation, and probably changes to LLVM comdats and the ELF writer. https://reviews.llvm.org/D26772