[all-commits] [llvm/llvm-project] 525bfa: [lld-macho] Emit personalities in compact unwind

Jez Ng via All-commits all-commits at lists.llvm.org
Mon Feb 8 10:48:27 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 525bfa10ec1d4e3dfa3932a299cd67ffe59a5827
      https://github.com/llvm/llvm-project/commit/525bfa10ec1d4e3dfa3932a299cd67ffe59a5827
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M lld/MachO/SyntheticSections.cpp
    M lld/MachO/UnwindInfoSection.cpp
    M lld/MachO/UnwindInfoSection.h
    M lld/MachO/Writer.cpp
    A lld/test/MachO/compact-unwind-generated.test
    R lld/test/MachO/compact-unwind-pie.s
    A lld/test/MachO/compact-unwind.s
    R lld/test/MachO/compact-unwind.test
    A lld/test/MachO/invalid/compact-unwind-bad-reloc.s
    A lld/test/MachO/invalid/compact-unwind-personalities.s
    M lld/test/MachO/tools/validate-unwind-info.py

  Log Message:
  -----------
  [lld-macho] Emit personalities in compact unwind

Note that there is a triple indirection involved with
personalities and compact unwind:

1. Two bits of each CU encoding are used as an offset into the
   personality array.
2. Each entry of the personality array is an offset from the image base.
   The resulting address (after adding the image base) should point within the
   GOT.
3. The corresponding GOT entry contains the actual pointer to the
   personality function.

To further complicate things, when the personality function is in the
object file (as opposed to a dylib), its references in
`__compact_unwind` may refer to it via a section + offset relocation
instead of a symbol relocation. Since our GOT implementation can only
create entries for symbols, we have to create a synthetic symbol at the
given section offset.

Reviewed By: clayborg

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


  Commit: 51120357510949fe33cec85b088e1e8a1f46de3f
      https://github.com/llvm/llvm-project/commit/51120357510949fe33cec85b088e1e8a1f46de3f
  Author: Jez Ng <jezng at fb.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M lld/MachO/UnwindInfoSection.cpp
    M lld/MachO/UnwindInfoSection.h
    M lld/test/MachO/compact-unwind.s

  Log Message:
  -----------
  [lld-macho] Emit LSDA info in compact unwind

The LSDA pointers are encoded as offsets from the image base,
and arranged in one big contiguous array. Each second-level page records
the offset within that LSDA array which corresponds to the LSDA for its
first CU entry.

Reviewed By: clayborg

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


Compare: https://github.com/llvm/llvm-project/compare/a719b667a979...511203575109


More information about the All-commits mailing list