[PATCH] D104978: [lld/mac] Don't fold UNWIND_X86_64_MODE_STACK_IND unwind entries

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 26 07:46:57 PDT 2021


thakis created this revision.
thakis added a reviewer: lld-macho.
Herald added a subscriber: pengfei.
Herald added a reviewer: int3.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
thakis requested review of this revision.

libunwind uses unwind info to find the function address belonging
to the current instruction pointer. libunwind/src/CompactUnwinder.hpp's
step functions read functionStart for UNWIND_X86_64_MODE_STACK_IND
(and for nothing else), so these encodings need a dedicated entry
per function, so that the runtime can get the stacksize off the
`subq` instrunction in the function's prologue.

This matches ld64.

(CompactUnwinder.hpp from https://opensource.apple.com/source/libunwind/
also reads functionStart in a few more cases if `SUPPORT_OLD_BINARIES` is set,
but it defaults to 0, and ld64 seems to not worry about these additional
cases.)

Related upstream bug: https://crbug.com/1220175


https://reviews.llvm.org/D104978

Files:
  lld/MachO/UnwindInfoSection.cpp
  lld/test/MachO/compact-unwind-stack-ind.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104978.354685.patch
Type: text/x-patch
Size: 3710 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210626/52e2389b/attachment.bin>


More information about the llvm-commits mailing list