[all-commits] [llvm/llvm-project] 31760e: [lld-macho] `-exported_symbols` should hide symbol...

Jez Ng via All-commits all-commits at lists.llvm.org
Thu Jul 28 14:56:05 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 31760e8189c969d2687c7fa8d67771ab185dd2fb
      https://github.com/llvm/llvm-project/commit/31760e8189c969d2687c7fa8d67771ab185dd2fb
  Author: Jez Ng <jezng at fb.com>
  Date:   2022-07-28 (Thu, 28 Jul 2022)

  Changed paths:
    M lld/MachO/Driver.cpp
    A lld/test/MachO/lto-explicit-exports.ll

  Log Message:
  -----------
  [lld-macho] `-exported_symbols` should hide symbols before LTO runs

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.

Reviewed By: #lld-macho, thevinster

Differential Revision: https://reviews.llvm.org/D130429




More information about the All-commits mailing list