[PATCH] D130429: [lld-macho] `-exported_symbols` should hide symbols before LTO runs

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 23 10:14:04 PDT 2022


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

We were previously doing it after LTO, which did have the desired effect
of having the un-exported symbols marked as private extern in the final
output binary, but doing it before LTO creates more optimization
opportunities.

One observable difference is that LTO can now elide un-exported symbols
entirely, so they may not even be present as private externs in the
output.

This is also what ld64 implements.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130429

Files:
  lld/MachO/Driver.cpp
  lld/test/MachO/lto-exported-symbol.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130429.447084.patch
Type: text/x-patch
Size: 5417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220723/365cdf79/attachment.bin>


More information about the llvm-commits mailing list