[PATCH] D99105: [lld-macho] LTO: Properly set VisibleToRegularObj

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 22 12:45:55 PDT 2021


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

This allows LLVM's LTO to internalize symbols that are not referenced
directly by regular objects. Naturally, this means we need to track
which symbols are referenced by regular objects. The approach taken here
is similar to LLD-COFF's: like the COFF port, we extend
`SymbolTable::insert()` to set the isVisibleToRegularObj bit. (LLD-ELF
relies on the Symbol constructor and `Symbol::mergeProperties()`, but
the Mach-O port does not have a `mergeProperties()` equivalent.)

internalize.ll is based off the LLD-ELF tests `internalize-basic.ll` and
`internalize-undef.ll`. Looks like @davide added some of LLD-ELF's internalize
tests, so adding him as a reviewer...


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99105

Files:
  lld/MachO/LTO.cpp
  lld/MachO/SymbolTable.cpp
  lld/MachO/SymbolTable.h
  lld/MachO/Symbols.h
  lld/test/MachO/internalize.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99105.332403.patch
Type: text/x-patch
Size: 7402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210322/08165872/attachment.bin>


More information about the llvm-commits mailing list