[PATCH] D105482: [lld/mac] Partially implement -export_dynamic

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 6 07:29:10 PDT 2021


thakis created this revision.
thakis added a reviewer: lld-macho.
Herald added subscribers: ormris, dang, steven_wu, hiraditya.
Herald added a reviewer: int3.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
thakis requested review of this revision.

This implements the part of -export_dynamic that adds external
symbols as dead strip roots even for executables.

It does not yet implement the effect -export_dynamic has for LTO.
I tried just replacing `config->outputType != MH_EXECUTE` with
`(config->outputType != MH_EXECUTE || config->exportDynamic)` in
LTO.cpp, but then local symbols make it into the symbol table too,
which is too much (and also doesn't match ld64). So punt on this
for now until I understand it better.
(D91583 <https://reviews.llvm.org/D91583> may or may not be related too).


https://reviews.llvm.org/D105482

Files:
  lld/MachO/Config.h
  lld/MachO/Driver.cpp
  lld/MachO/LTO.cpp
  lld/MachO/MarkLive.cpp
  lld/MachO/Options.td
  lld/test/MachO/dead-strip.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105482.356716.patch
Type: text/x-patch
Size: 4747 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210706/e0317e62/attachment.bin>


More information about the llvm-commits mailing list