[PATCH] D157136: [LLD][COFF] Handle 'label' symbols when they point to a COMDAT section

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 13:43:43 PDT 2023


aganea created this revision.
aganea added reviewers: rnk, mstorsjo, thieta, compnerd.
Herald added a project: All.
aganea requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This fixes an issue where OBJs files containing a malformed `.text$x` section references `label` symbols (that is `IMAGE_SYM_CLASS_LABEL`) that live in a COMDAT `.text$mn`. This kind of OBJ files are only generated by MSVC. This seems to be a long-standing issue in MSVC, but the conditions to generate it when using `cl.exe` are still unknown. A tentative reproducer can be found here in https://github.com/llvm/llvm-project/issues/62182. This patch already contains a test that covers the bug.

Fixes PR62182 <https://github.com/llvm/llvm-project/issues/62182>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157136

Files:
  lld/COFF/InputFiles.cpp
  lld/COFF/InputFiles.h
  lld/test/COFF/Inputs/comdat-malformed-assoc-a.yaml
  lld/test/COFF/Inputs/comdat-malformed-assoc-b.yaml
  lld/test/COFF/comdat-selection.s
  llvm/include/llvm/Object/COFF.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157136.547331.patch
Type: text/x-patch
Size: 17712 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230804/373cfc52/attachment.bin>


More information about the llvm-commits mailing list