Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 52bcc7c

Browse files
committed
Fix unwinding through assembly helpers
NESTED_ENTRY/NESTED_END assembly helpers are currently using cfi ops that are not supported by Apple's compact unwind format. Additionally the apple linker appears to be doing the wrong thing, and mapping functions like CallDescrWorkerInternal to an invalid compatc unwind encoding. This patch manually emits the __compact_unwind section manually for the affected functions, and points the unwinder to parse the DWARF instead of using the compact table.
1 parent 65843fd commit 52bcc7c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/pal/inc/unixasmmacros.inc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ C_FUNC(\Name\()_End):
9494

9595
.macro NESTED_END Name, Section
9696
LEAF_END \Name, \Section
97+
#if defined(__APPLE__)
98+
.section __LD,__compact_unwind,regular,debug
99+
.quad C_FUNC(\Name)
100+
.set C_FUNC(\Name\()_Size), C_FUNC(\Name\()_End) - C_FUNC(\Name)
101+
.long C_FUNC(\Name\()_Size)
102+
.long 0x04000000 # DWARF
103+
.quad 0
104+
.quad 0
105+
#endif
97106
.endm
98107

99108
.macro END_PROLOGUE

0 commit comments

Comments
 (0)