[PATCH] D104605: [LLD] [COFF] Fix handling of LTO comdats with nontrivial selection types after 728cc0075e5dfdb454eb

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 20 14:19:40 PDT 2021


mstorsjo created this revision.
mstorsjo added a reviewer: rnk.
Herald added subscribers: ormris, steven_wu, hiraditya, inglorion.
mstorsjo requested review of this revision.
Herald added a project: LLVM.

Commit 728cc0075e5dfdb454ebe6418b63bdffae71ec14 <https://reviews.llvm.org/rG728cc0075e5dfdb454ebe6418b63bdffae71ec14> made comdat symbols
from LTO objects be treated as any regular comdat symbol. This works
great for symbols that actually are IMAGE_COMDAT_SELECT_ANY, but
if e.g. the symbols have a less trivial selection type, like
IMAGE_COMDAT_SELECT_SAME_SIZE, we can't check that between the plain
symbol from the bitcode file (before actually doing the LTO compilation)
and other regular object files.

Therefore bring back one aspect of handling from before; that comdat
resolution with a leader from an LTO symbol is essentially skipped,
like it was before 728cc0075e5dfdb454ebe6418b63bdffae71ec14 <https://reviews.llvm.org/rG728cc0075e5dfdb454ebe6418b63bdffae71ec14>.

Or is there any better way of including the info about the kind of
symbol for the leader? Previously we could check leader->data to see
if it was a regular or LTO symbol. Overall we'd of course want to make
LTO cases behave more like regular symbols, but for this aspect, I
don't think we practically can?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104605

Files:
  lld/COFF/InputFiles.cpp
  lld/test/COFF/lto-comdat-samesize.ll
  llvm/include/llvm/BinaryFormat/COFF.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104605.353242.patch
Type: text/x-patch
Size: 3860 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210620/8e26a38a/attachment.bin>


More information about the llvm-commits mailing list