Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 65da63a

Browse files
jeremyhuatgreen
authored andcommitted
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 <[email protected]> * x86: Use __text as the section name to avoid deprecated section name warnings. Signed-off-by: Jeremy Huddleston Sequoia <[email protected]> * darwin: Add missing regular,debug attributes for compact unwind sections Signed-off-by: Jeremy Huddleston Sequoia <[email protected]>
1 parent 2309b58 commit 65da63a

File tree

2 files changed

+79
-2
lines changed

2 files changed

+79
-2
lines changed

src/x86/sysv.S

Lines changed: 78 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ ENDF(C(ffi_closure_raw_THISCALL))
792792

793793
#ifdef X86_DARWIN
794794
# define COMDAT(X) \
795-
.section __TEXT,__textcoal_nt,coalesced,pure_instructions; \
795+
.section __TEXT,__text,coalesced,pure_instructions; \
796796
.weak_definition X; \
797797
.private_extern X
798798
#elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__))
@@ -1044,6 +1044,83 @@ L(EFDE9):
10441044
@feat.00 = 1
10451045
#endif
10461046

1047+
#ifdef __APPLE__
1048+
.subsections_via_symbols
1049+
.section __LD,__compact_unwind,regular,debug
1050+
1051+
/* compact unwind for ffi_call_i386 */
1052+
.long C(ffi_call_i386)
1053+
.set L1,L(UW5)-L(UW0)
1054+
.long L1
1055+
.long 0x04000000 /* use dwarf unwind info */
1056+
.long 0
1057+
.long 0
1058+
1059+
/* compact unwind for ffi_go_closure_EAX */
1060+
.long C(ffi_go_closure_EAX)
1061+
.set L2,L(UW8)-L(UW6)
1062+
.long L2
1063+
.long 0x04000000 /* use dwarf unwind info */
1064+
.long 0
1065+
.long 0
1066+
1067+
/* compact unwind for ffi_go_closure_ECX */
1068+
.long C(ffi_go_closure_ECX)
1069+
.set L3,L(UW11)-L(UW9)
1070+
.long L3
1071+
.long 0x04000000 /* use dwarf unwind info */
1072+
.long 0
1073+
.long 0
1074+
1075+
/* compact unwind for ffi_closure_i386 */
1076+
.long C(ffi_closure_i386)
1077+
.set L4,L(UW20)-L(UW12)
1078+
.long L4
1079+
.long 0x04000000 /* use dwarf unwind info */
1080+
.long 0
1081+
.long 0
1082+
1083+
/* compact unwind for ffi_go_closure_STDCALL */
1084+
.long C(ffi_go_closure_STDCALL)
1085+
.set L5,L(UW23)-L(UW21)
1086+
.long L5
1087+
.long 0x04000000 /* use dwarf unwind info */
1088+
.long 0
1089+
.long 0
1090+
1091+
/* compact unwind for ffi_closure_REGISTER */
1092+
.long C(ffi_closure_REGISTER)
1093+
.set L6,L(UW26)-L(UW24)
1094+
.long L6
1095+
.long 0x04000000 /* use dwarf unwind info */
1096+
.long 0
1097+
.long 0
1098+
1099+
/* compact unwind for ffi_closure_STDCALL */
1100+
.long C(ffi_closure_STDCALL)
1101+
.set L7,L(UW31)-L(UW27)
1102+
.long L7
1103+
.long 0x04000000 /* use dwarf unwind info */
1104+
.long 0
1105+
.long 0
1106+
1107+
/* compact unwind for ffi_closure_raw_SYSV */
1108+
.long C(ffi_closure_raw_SYSV)
1109+
.set L8,L(UW40)-L(UW32)
1110+
.long L8
1111+
.long 0x04000000 /* use dwarf unwind info */
1112+
.long 0
1113+
.long 0
1114+
1115+
/* compact unwind for ffi_closure_raw_THISCALL */
1116+
.long C(ffi_closure_raw_THISCALL)
1117+
.set L9,L(UW52)-L(UW41)
1118+
.long L9
1119+
.long 0x04000000 /* use dwarf unwind info */
1120+
.long 0
1121+
.long 0
1122+
#endif /* __APPLE__ */
1123+
10471124
#endif /* ifndef _MSC_VER */
10481125
#endif /* ifndef __x86_64__ */
10491126

src/x86/unix64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ L(SFDE5):
517517
L(EFDE5):
518518
#ifdef __APPLE__
519519
.subsections_via_symbols
520-
.section __LD,__compact_unwind
520+
.section __LD,__compact_unwind,regular,debug
521521

522522
/* compact unwind for ffi_call_unix64 */
523523
.quad C(ffi_call_unix64)

0 commit comments

Comments
 (0)