[all-commits] [llvm/llvm-project] fd3669: [lld-macho] Improve hiding of unnamed_addr symbols

Jez Ng via All-commits all-commits at lists.llvm.org
Fri Feb 18 09:09:54 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd3669c2567302d34d9dd2222ee97204e4e26d4a
      https://github.com/llvm/llvm-project/commit/fd3669c2567302d34d9dd2222ee97204e4e26d4a
  Author: Jez Ng <jezng at fb.com>
  Date:   2022-02-18 (Fri, 18 Feb 2022)

  Changed paths:
    M lld/MachO/InputFiles.cpp
    A lld/test/MachO/lto-internalize-unnamed-addr.ll

  Log Message:
  -----------
  [lld-macho] Improve hiding of unnamed_addr symbols

Symbols for which `canBeOmittedFromSymbolTable()` is true should be
treated as private externs. This diff tries to do that by unsetting the
ExportDynamic bit. It seems to mostly work with the FullLTO backend, but
with the ThinLTO backend, the `local_unnamed_addr` symbols still fail to
be properly hidden. Nonetheless, this is a step in the right direction.

I've documented all the remaining differences between our behavior and
LD64's in the lto-internalized-unnamed-addr.ll test.

See also https://discourse.llvm.org/t/mach-o-lto-handling-of-linkonce-odr-unnamed-addr/60015

Reviewed By: #lld-macho, thevinster

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




More information about the All-commits mailing list