[all-commits] [llvm/llvm-project] a745e4: [MachO] Fix dead-stripping __eh_frame

Shoaib Meenai via All-commits all-commits at lists.llvm.org
Sat Aug 27 02:58:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a745e47900dde15c180d5caea7a1d292ca809eb1
      https://github.com/llvm/llvm-project/commit/a745e47900dde15c180d5caea7a1d292ca809eb1
  Author: Shoaib Meenai <smeenai at fb.com>
  Date:   2022-08-27 (Sat, 27 Aug 2022)

  Changed paths:
    M lld/MachO/InputFiles.cpp
    A lld/test/MachO/eh-frame-dead-strip.s

  Log Message:
  -----------
  [MachO] Fix dead-stripping __eh_frame

This section is marked S_ATTR_LIVE_SUPPORT in input files, which meant
that on arm64, we were unnecessarily preserving FDEs if we e.g. had
multiple weak definitions for a function. Worse, we would actually
produce an invalid `__eh_frame` section in that case, because the CIE
associated with the unnecessary FDE would still get dead-stripped and
we'd end up with a dangling FDE. We set up associations from functions
to their FDEs, so dead-stripping will just work naturally, and we can
clear S_ATTR_LIVE_SUPPORT from our input `__eh_frame` sections to fix
dead-stripping.

Reviewed By: #lld-macho, int3

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




More information about the All-commits mailing list