[PATCH] D103043: [Internalize] Rename instead of removal if a to-be-internalized comdat has more than one member

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 24 16:30:34 PDT 2021


MaskRay added a comment.

In D103043#2778216 <https://reviews.llvm.org/D103043#2778216>, @xur wrote:

> I can understand the single member comdat part -- it should be safe to internalize it without break anything. I'm not sure I follow the rename part. Why can't the linker  handle the duplicated comdat? Is deduplication should be done by linker?

On PE-COFF, a comdat with a non-external selection symbol does not deduplicate.

On ELF, a comdat with a STB_LOCAL signature symbol still deduplicates with all of ld.lld/GNU ld/gold. If a non-internal comdat in a.o is prevailed by an internal comdat in b.o, the a.o references to the comdat definitions will be un-resolvable (references cannot bind to STB_LOCAL definitions in b.o)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103043/new/

https://reviews.llvm.org/D103043



More information about the llvm-commits mailing list