Add compact unwind for darwin/i386 (#440)
authorJeremy Huddleston Sequoia <jeremyhu@users.noreply.github.com>
Mon, 25 Jun 2018 11:38:58 +0000 (04:38 -0700)
committerAnthony Green <green@moxielogic.com>
Mon, 25 Jun 2018 11:38:58 +0000 (07:38 -0400)
* 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>
src/x86/sysv.S
src/x86/unix64.S

index 52f307a04876897a9de5e1f2fdd6049183f5a8d9..49fd80c6e68a9604c2496413ccc5bbdf75eaa8b3 100644 (file)
@@ -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__ */
 
index d3987408f7101fe004e006d2aec986d380a97a86..41563f5c60f8c3e3e506ccee4320d7f25d52f856 100644 (file)
@@ -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)