[PATCH] D133165: [lld][COFF] Add support for overriding weak symbols in LLVM bitcode input

Alan Zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 16:06:56 PDT 2022


ayzhao created this revision.
Herald added a project: All.
ayzhao requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

LLVM bitcode contains support for weak symbols, so we can add support
for overriding weak symbols in the output COFF even though COFF doesn't
have inherent support for weak symbols.

The motivation for this patch is that Chromium is trying to use libc++'s
assertion handler mechanism, which relies on weak symbols [0], but we're
unable to perform a ThinLTO build on Windows due to this problem [1].

[0]: https://reviews.llvm.org/D121478
[1]: https://crrev.com/c/3863576


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133165

Files:
  lld/COFF/InputFiles.cpp
  lld/COFF/SymbolTable.cpp
  lld/COFF/SymbolTable.h
  lld/COFF/Symbols.h
  lld/test/COFF/Inputs/strong-def.ll
  lld/test/COFF/Inputs/weak-def.ll
  lld/test/COFF/weak-override.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133165.457437.patch
Type: text/x-patch
Size: 5684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220901/0629dc3f/attachment.bin>


More information about the llvm-commits mailing list