[PATCH] D106597: [lld-macho] Add support for common bitcode symbols

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 14:23:39 PDT 2021


int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added subscribers: ormris, steven_wu, hiraditya.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
int3 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

For some reason, ld64 gives common bitcode symbols a lower
priority than common non-bitcode symbols. As such, I've created a
BitcodeCommonSymbol in order to handle this.

Note that we still deviate from ld64's behavior in some cases,
particularly when bitcode and non-bitcode symbols of the same name are
mixed. I doubt such a situation occurs often in practice, so it should
be fine. I would like to avoid overly complicating our implementation
unless necessary. I've added comments in the test to highlight these
cases.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106597

Files:
  lld/MachO/ConcatOutputSection.cpp
  lld/MachO/InputFiles.cpp
  lld/MachO/SymbolTable.cpp
  lld/MachO/SymbolTable.h
  lld/MachO/Symbols.h
  lld/test/MachO/lto-common-symbol-coalescing.ll
  lld/test/MachO/lto-common-symbol-resolution.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106597.360975.patch
Type: text/x-patch
Size: 16233 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210722/fdf39e04/attachment.bin>


More information about the llvm-commits mailing list