[all-commits] [llvm/llvm-project] 7f60ed: [reland][lld-macho] Private label aliases to weak ...

Jez Ng via All-commits all-commits at lists.llvm.org
Fri Dec 23 11:52:39 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7f60ed12effade437028b938ea463f37020f89fd
      https://github.com/llvm/llvm-project/commit/7f60ed12effade437028b938ea463f37020f89fd
  Author: Jez Ng <jezng at fb.com>
  Date:   2022-12-23 (Fri, 23 Dec 2022)

  Changed paths:
    M lld/MachO/InputFiles.cpp
    M lld/MachO/UnwindInfoSection.cpp
    A lld/test/MachO/weak-def-alias-private-label.s

  Log Message:
  -----------
  [reland][lld-macho] Private label aliases to weak symbols should not retain section data

This reverts commit a650f2ec7a37cf1f495108bbb313e948c232c29c.

The crashes it was causing will be fixed by the stacked diff {D140606}.


  Commit: 61f94f2768e6b74beb91b96b03630bbf72b9bfaa
      https://github.com/llvm/llvm-project/commit/61f94f2768e6b74beb91b96b03630bbf72b9bfaa
  Author: Jez Ng <jezng at fb.com>
  Date:   2022-12-23 (Fri, 23 Dec 2022)

  Changed paths:
    M lld/MachO/InputFiles.cpp
    A lld/test/MachO/private-label-alias.s
    R lld/test/MachO/weak-def-alias-private-label.s

  Log Message:
  -----------
  [lld-macho] Only fold private-label aliases that do not have flags

This will enable us to re-land {D139069}.

The issue with the original diff was that we were folding all
private-label symbols. We were not merging the symbol flags during this
folding; instead we just made all references to the folded symbol point
to its aliasee. This caused some flags to be incorrectly discarded. This
surfaced as code that was incorrectly stripped due to LLD dropping the
`.no_dead_strip` flag.

This diff fixes things by only folding flag-less private-label aliases.
Most (maybe all) of the `ltmp<N>` symbols that are generated by the MC
aarch64 backend are flag-less, so this conservative folding behavior
does the job.

Reviewed By: #lld-macho, thakis

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


Compare: https://github.com/llvm/llvm-project/compare/08d1d74289f4...61f94f2768e6


More information about the All-commits mailing list