Add compact unwind for darwin/i386 (#440) * x86: Add implementation of compact unwind for ffi_call_i386, et al. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org> * x86: Use __text as the section name to avoid deprecated section name warnings. Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org> * darwin: Add missing regular,debug attributes for compact unwind sections Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
diff --git a/src/x86/sysv.S b/src/x86/sysv.S
index 52f307a..49fd80c 100644
--- a/src/x86/sysv.S
+++ b/src/x86/sysv.S
@@ -792,7 +792,7 @@ ENDF(C(ffi_closure_raw_THISCALL))
#ifdef X86_DARWIN
# define COMDAT(X) \
- .section __TEXT,__textcoal_nt,coalesced,pure_instructions; \
+ .section __TEXT,__text,coalesced,pure_instructions; \
.weak_definition X; \
.private_extern X
#elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__))
@@ -1044,6 +1044,83 @@ L(EFDE9):
@feat.00 = 1
#endif
+#ifdef __APPLE__
+ .subsections_via_symbols
+ .section __LD,__compact_unwind,regular,debug
+
+ /* compact unwind for ffi_call_i386 */
+ .long C(ffi_call_i386)
+ .set L1,L(UW5)-L(UW0)
+ .long L1
+ .long 0x04000000 /* use dwarf unwind info */
+ .long 0
+ .long 0
+
+ /* compact unwind for ffi_go_closure_EAX */
+ .long C(ffi_go_closure_EAX)
+ .set L2,L(UW8)-L(UW6)
+ .long L2
+ .long 0x04000000 /* use dwarf unwind info */
+ .long 0
+ .long 0
+
+ /* compact unwind for ffi_go_closure_ECX */
+ .long C(ffi_go_closure_ECX)
+ .set L3,L(UW11)-L(UW9)
+ .long L3
+ .long 0x04000000 /* use dwarf unwind info */
+ .long 0
+ .long 0
+
+ /* compact unwind for ffi_closure_i386 */
+ .long C(ffi_closure_i386)
+ .set L4,L(UW20)-L(UW12)
+ .long L4
+ .long 0x04000000 /* use dwarf unwind info */
+ .long 0
+ .long 0
+
+ /* compact unwind for ffi_go_closure_STDCALL */
+ .long C(ffi_go_closure_STDCALL)
+ .set L5,L(UW23)-L(UW21)
+ .long L5
+ .long 0x04000000 /* use dwarf unwind info */
+ .long 0
+ .long 0
+
+ /* compact unwind for ffi_closure_REGISTER */
+ .long C(ffi_closure_REGISTER)
+ .set L6,L(UW26)-L(UW24)
+ .long L6
+ .long 0x04000000 /* use dwarf unwind info */
+ .long 0
+ .long 0
+
+ /* compact unwind for ffi_closure_STDCALL */
+ .long C(ffi_closure_STDCALL)
+ .set L7,L(UW31)-L(UW27)
+ .long L7
+ .long 0x04000000 /* use dwarf unwind info */
+ .long 0
+ .long 0
+
+ /* compact unwind for ffi_closure_raw_SYSV */
+ .long C(ffi_closure_raw_SYSV)
+ .set L8,L(UW40)-L(UW32)
+ .long L8
+ .long 0x04000000 /* use dwarf unwind info */
+ .long 0
+ .long 0
+
+ /* compact unwind for ffi_closure_raw_THISCALL */
+ .long C(ffi_closure_raw_THISCALL)
+ .set L9,L(UW52)-L(UW41)
+ .long L9
+ .long 0x04000000 /* use dwarf unwind info */
+ .long 0
+ .long 0
+#endif /* __APPLE__ */
+
#endif /* ifndef _MSC_VER */
#endif /* ifndef __x86_64__ */
diff --git a/src/x86/unix64.S b/src/x86/unix64.S
index d398740..41563f5 100644
--- a/src/x86/unix64.S
+++ b/src/x86/unix64.S
@@ -517,7 +517,7 @@ L(SFDE5):
L(EFDE5):
#ifdef __APPLE__
.subsections_via_symbols
- .section __LD,__compact_unwind
+ .section __LD,__compact_unwind,regular,debug
/* compact unwind for ffi_call_unix64 */
.quad C(ffi_call_unix64)