1 /* -----------------------------------------------------------------------
2 sysv.S - Copyright (c) 2013 The Written Word, Inc.
3 - Copyright (c) 1996,1998,2001-2003,2005,2008,2010 Red Hat, Inc.
5 X86 Foreign Function Interface
7 Permission is hereby granted, free of charge, to any person obtaining
8 a copy of this software and associated documentation files (the
9 ``Software''), to deal in the Software without restriction, including
10 without limitation the rights to use, copy, modify, merge, publish,
11 distribute, sublicense, and/or sell copies of the Software, and to
12 permit persons to whom the Software is furnished to do so, subject to
13 the following conditions:
15 The above copyright notice and this permission notice shall be included
16 in all copies or substantial portions of the Software.
18 THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26 ----------------------------------------------------------------------- */
31 #include <fficonfig.h>
35 #define C2(X, Y) X ## Y
36 #define C1(X, Y) C2(X, Y)
37 #ifdef __USER_LABEL_PREFIX__
38 # define C(X) C1(__USER_LABEL_PREFIX__, X)
44 # define L(X) C1(L, X)
46 # define L(X) C1(.L, X)
50 # define ENDF(X) .type X,@function; .size X, . - X
55 /* Handle win32 fastcall name mangling. */
57 # define ffi_call_i386 @ffi_call_i386@8
58 # define ffi_closure_inner @ffi_closure_inner@8
60 # define ffi_call_i386 C(ffi_call_i386)
61 # define ffi_closure_inner C(ffi_closure_inner)
64 /* This macro allows the safe creation of jump tables without an
65 actual table. The entry points into the table are all 8 bytes.
66 The use of ORG asserts that we're at the correct location. */
67 /* ??? The clang assembler doesn't handle .org with symbolic expressions. */
68 #if defined(__clang__) || defined(__APPLE__) || (defined (__sun__) && defined(__svr4__))
69 # define E(BASE, X) .balign 8
71 # define E(BASE, X) .balign 8; .org BASE + X * 8
77 FFI_HIDDEN(ffi_call_i386)
79 /* This is declared as
81 void ffi_call_i386(struct call_frame *frame, char *argp)
82 __attribute__((fastcall));
84 Thus the arguments are present in
97 movl (%esp), %eax /* move the return address */
98 movl %ebp, (%ecx) /* store %ebp into local frame */
99 movl %eax, 4(%ecx) /* store retaddr into local frame */
101 /* New stack frame based off ebp. This is a itty bit of unwind
102 trickery in that the CFA *has* changed. There is no easy way
103 to describe it correctly on entry to the function. Fortunately,
104 it doesn't matter too much since at all points we can correctly
105 unwind back to ffi_call. Note that the location to which we
106 moved the return address is (the new) CFA-4, so from the
107 perspective of the unwind info, it hasn't moved. */
110 # cfi_def_cfa(%ebp, 8)
111 # cfi_rel_offset(%ebp, 0)
113 movl %edx, %esp /* set outgoing argument stack */
114 movl 20+R_EAX*4(%ebp), %eax /* set register arguments */
115 movl 20+R_EDX*4(%ebp), %edx
116 movl 20+R_ECX*4(%ebp), %ecx
120 movl 12(%ebp), %ecx /* load return type code */
121 movl %ebx, 8(%ebp) /* preserve %ebx */
123 # cfi_rel_offset(%ebx, 8)
125 andl $X86_RET_TYPE_MASK, %ecx
127 call C(__x86.get_pc_thunk.bx)
129 leal L(store_table)-L(pc1)(%ebx, %ecx, 8), %ebx
131 leal L(store_table)(,%ecx, 8), %ebx
133 movl 16(%ebp), %ecx /* load result address */
138 E(L(store_table), X86_RET_FLOAT)
141 E(L(store_table), X86_RET_DOUBLE)
144 E(L(store_table), X86_RET_LDOUBLE)
147 E(L(store_table), X86_RET_SINT8)
151 E(L(store_table), X86_RET_SINT16)
155 E(L(store_table), X86_RET_UINT8)
159 E(L(store_table), X86_RET_UINT16)
163 E(L(store_table), X86_RET_INT64)
166 E(L(store_table), X86_RET_INT32)
169 E(L(store_table), X86_RET_VOID)
176 # cfi_def_cfa(%esp, 4)
183 E(L(store_table), X86_RET_STRUCTPOP)
185 E(L(store_table), X86_RET_STRUCTARG)
187 E(L(store_table), X86_RET_STRUCT_1B)
190 E(L(store_table), X86_RET_STRUCT_2B)
194 /* Fill out the table so that bad values are predictable. */
195 E(L(store_table), X86_RET_UNUSED14)
197 E(L(store_table), X86_RET_UNUSED15)
204 /* The inner helper is declared as
206 void ffi_closure_inner(struct closure_frame *frame, char *argp)
207 __attribute_((fastcall))
209 Thus the arguments are placed in
215 /* Macros to help setting up the closure_data structure. */
218 # define closure_FS (40 + 4)
219 # define closure_CF 0
221 # define closure_FS (8 + 40 + 12)
222 # define closure_CF 8
225 #define FFI_CLOSURE_SAVE_REGS \
226 movl %eax, closure_CF+16+R_EAX*4(%esp); \
227 movl %edx, closure_CF+16+R_EDX*4(%esp); \
228 movl %ecx, closure_CF+16+R_ECX*4(%esp)
230 #define FFI_CLOSURE_COPY_TRAMP_DATA \
231 movl FFI_TRAMPOLINE_SIZE(%eax), %edx; /* copy cif */ \
232 movl FFI_TRAMPOLINE_SIZE+4(%eax), %ecx; /* copy fun */ \
233 movl FFI_TRAMPOLINE_SIZE+8(%eax), %eax; /* copy user_data */ \
234 movl %edx, closure_CF+28(%esp); \
235 movl %ecx, closure_CF+32(%esp); \
236 movl %eax, closure_CF+36(%esp)
239 # define FFI_CLOSURE_PREP_CALL \
240 movl %esp, %ecx; /* load closure_data */ \
241 leal closure_FS+4(%esp), %edx; /* load incoming stack */
243 # define FFI_CLOSURE_PREP_CALL \
244 leal closure_CF(%esp), %ecx; /* load closure_data */ \
245 leal closure_FS+4(%esp), %edx; /* load incoming stack */ \
250 #define FFI_CLOSURE_CALL_INNER(UWN) \
251 call ffi_closure_inner
253 #define FFI_CLOSURE_MASK_AND_JUMP(N, UW) \
254 andl $X86_RET_TYPE_MASK, %eax; \
255 leal L(C1(load_table,N))(, %eax, 8), %edx; \
256 movl closure_CF(%esp), %eax; /* optimiztic load */ \
260 # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
261 # undef FFI_CLOSURE_MASK_AND_JUMP
262 # define FFI_CLOSURE_MASK_AND_JUMP(N, UW) \
263 andl $X86_RET_TYPE_MASK, %eax; \
264 call C(__x86.get_pc_thunk.dx); \
266 leal L(C1(load_table,N))-L(C1(pc,N))(%edx, %eax, 8), %edx; \
267 movl closure_CF(%esp), %eax; /* optimiztic load */ \
270 # define FFI_CLOSURE_CALL_INNER_SAVE_EBX
271 # undef FFI_CLOSURE_CALL_INNER
272 # define FFI_CLOSURE_CALL_INNER(UWN) \
273 movl %ebx, 40(%esp); /* save ebx */ \
275 # cfi_rel_offset(%ebx, 40); \
276 call C(__x86.get_pc_thunk.bx); /* load got register */ \
277 addl $C(_GLOBAL_OFFSET_TABLE_), %ebx; \
278 call ffi_closure_inner@PLT
279 # undef FFI_CLOSURE_MASK_AND_JUMP
280 # define FFI_CLOSURE_MASK_AND_JUMP(N, UWN) \
281 andl $X86_RET_TYPE_MASK, %eax; \
282 leal L(C1(load_table,N))@GOTOFF(%ebx, %eax, 8), %edx; \
283 movl 40(%esp), %ebx; /* restore ebx */ \
285 # cfi_restore(%ebx); \
286 movl closure_CF(%esp), %eax; /* optimiztic load */ \
288 # endif /* DARWIN || HIDDEN */
292 .globl C(ffi_go_closure_EAX)
293 FFI_HIDDEN(C(ffi_go_closure_EAX))
294 C(ffi_go_closure_EAX):
297 subl $closure_FS, %esp
299 # cfi_def_cfa_offset(closure_FS + 4)
300 FFI_CLOSURE_SAVE_REGS
301 movl 4(%eax), %edx /* copy cif */
302 movl 8(%eax), %ecx /* copy fun */
303 movl %edx, closure_CF+28(%esp)
304 movl %ecx, closure_CF+32(%esp)
305 movl %eax, closure_CF+36(%esp) /* closure is user_data */
306 jmp L(do_closure_i386)
309 ENDF(C(ffi_go_closure_EAX))
312 .globl C(ffi_go_closure_ECX)
313 FFI_HIDDEN(C(ffi_go_closure_ECX))
314 C(ffi_go_closure_ECX):
317 subl $closure_FS, %esp
319 # cfi_def_cfa_offset(closure_FS + 4)
320 FFI_CLOSURE_SAVE_REGS
321 movl 4(%ecx), %edx /* copy cif */
322 movl 8(%ecx), %eax /* copy fun */
323 movl %edx, closure_CF+28(%esp)
324 movl %eax, closure_CF+32(%esp)
325 movl %ecx, closure_CF+36(%esp) /* closure is user_data */
326 jmp L(do_closure_i386)
329 ENDF(C(ffi_go_closure_ECX))
331 /* The closure entry points are reached from the ffi_closure trampoline.
332 On entry, %eax contains the address of the ffi_closure. */
335 .globl C(ffi_closure_i386)
336 FFI_HIDDEN(C(ffi_closure_i386))
341 subl $closure_FS, %esp
343 # cfi_def_cfa_offset(closure_FS + 4)
345 FFI_CLOSURE_SAVE_REGS
346 FFI_CLOSURE_COPY_TRAMP_DATA
348 /* Entry point from preceeding Go closures. */
351 FFI_CLOSURE_PREP_CALL
352 FFI_CLOSURE_CALL_INNER(14)
353 FFI_CLOSURE_MASK_AND_JUMP(2, 15)
357 E(L(load_table2), X86_RET_FLOAT)
358 flds closure_CF(%esp)
360 E(L(load_table2), X86_RET_DOUBLE)
361 fldl closure_CF(%esp)
363 E(L(load_table2), X86_RET_LDOUBLE)
364 fldt closure_CF(%esp)
366 E(L(load_table2), X86_RET_SINT8)
369 E(L(load_table2), X86_RET_SINT16)
372 E(L(load_table2), X86_RET_UINT8)
375 E(L(load_table2), X86_RET_UINT16)
378 E(L(load_table2), X86_RET_INT64)
379 movl closure_CF+4(%esp), %edx
381 E(L(load_table2), X86_RET_INT32)
384 E(L(load_table2), X86_RET_VOID)
386 addl $closure_FS, %esp
388 # cfi_adjust_cfa_offset(-closure_FS)
391 # cfi_adjust_cfa_offset(closure_FS)
392 E(L(load_table2), X86_RET_STRUCTPOP)
393 addl $closure_FS, %esp
395 # cfi_adjust_cfa_offset(-closure_FS)
398 # cfi_adjust_cfa_offset(closure_FS)
399 E(L(load_table2), X86_RET_STRUCTARG)
401 E(L(load_table2), X86_RET_STRUCT_1B)
404 E(L(load_table2), X86_RET_STRUCT_2B)
408 /* Fill out the table so that bad values are predictable. */
409 E(L(load_table2), X86_RET_UNUSED14)
411 E(L(load_table2), X86_RET_UNUSED15)
416 ENDF(C(ffi_closure_i386))
419 .globl C(ffi_go_closure_STDCALL)
420 FFI_HIDDEN(C(ffi_go_closure_STDCALL))
421 C(ffi_go_closure_STDCALL):
424 subl $closure_FS, %esp
426 # cfi_def_cfa_offset(closure_FS + 4)
427 FFI_CLOSURE_SAVE_REGS
428 movl 4(%ecx), %edx /* copy cif */
429 movl 8(%ecx), %eax /* copy fun */
430 movl %edx, closure_CF+28(%esp)
431 movl %eax, closure_CF+32(%esp)
432 movl %ecx, closure_CF+36(%esp) /* closure is user_data */
433 jmp L(do_closure_STDCALL)
436 ENDF(C(ffi_go_closure_STDCALL))
438 /* For REGISTER, we have no available parameter registers, and so we
439 enter here having pushed the closure onto the stack. */
442 .globl C(ffi_closure_REGISTER)
443 FFI_HIDDEN(C(ffi_closure_REGISTER))
444 C(ffi_closure_REGISTER):
447 # cfi_def_cfa(%esp, 8)
448 # cfi_offset(%eip, -8)
449 subl $closure_FS-4, %esp
451 # cfi_def_cfa_offset(closure_FS + 4)
452 FFI_CLOSURE_SAVE_REGS
453 movl closure_FS-4(%esp), %ecx /* load retaddr */
454 movl closure_FS(%esp), %eax /* load closure */
455 movl %ecx, closure_FS(%esp) /* move retaddr */
456 jmp L(do_closure_REGISTER)
459 ENDF(C(ffi_closure_REGISTER))
461 /* For STDCALL (and others), we need to pop N bytes of arguments off
462 the stack following the closure. The amount needing to be popped
463 is returned to us from ffi_closure_inner. */
466 .globl C(ffi_closure_STDCALL)
467 FFI_HIDDEN(C(ffi_closure_STDCALL))
468 C(ffi_closure_STDCALL):
471 subl $closure_FS, %esp
473 # cfi_def_cfa_offset(closure_FS + 4)
475 FFI_CLOSURE_SAVE_REGS
477 /* Entry point from ffi_closure_REGISTER. */
478 L(do_closure_REGISTER):
480 FFI_CLOSURE_COPY_TRAMP_DATA
482 /* Entry point from preceeding Go closure. */
483 L(do_closure_STDCALL):
485 FFI_CLOSURE_PREP_CALL
486 FFI_CLOSURE_CALL_INNER(29)
489 shrl $X86_RET_POP_SHIFT, %ecx /* isolate pop count */
490 leal closure_FS(%esp, %ecx), %ecx /* compute popped esp */
491 movl closure_FS(%esp), %edx /* move return address */
494 /* From this point on, the value of %esp upon return is %ecx+4,
495 and we've copied the return address to %ecx to make return easy.
496 There's no point in representing this in the unwind info, as
497 there is always a window between the mov and the ret which
498 will be wrong from one point of view or another. */
500 FFI_CLOSURE_MASK_AND_JUMP(3, 30)
504 E(L(load_table3), X86_RET_FLOAT)
505 flds closure_CF(%esp)
508 E(L(load_table3), X86_RET_DOUBLE)
509 fldl closure_CF(%esp)
512 E(L(load_table3), X86_RET_LDOUBLE)
513 fldt closure_CF(%esp)
516 E(L(load_table3), X86_RET_SINT8)
520 E(L(load_table3), X86_RET_SINT16)
524 E(L(load_table3), X86_RET_UINT8)
528 E(L(load_table3), X86_RET_UINT16)
532 E(L(load_table3), X86_RET_INT64)
533 movl closure_CF+4(%esp), %edx
536 E(L(load_table3), X86_RET_INT32)
539 E(L(load_table3), X86_RET_VOID)
542 E(L(load_table3), X86_RET_STRUCTPOP)
545 E(L(load_table3), X86_RET_STRUCTARG)
548 E(L(load_table3), X86_RET_STRUCT_1B)
552 E(L(load_table3), X86_RET_STRUCT_2B)
557 /* Fill out the table so that bad values are predictable. */
558 E(L(load_table3), X86_RET_UNUSED14)
560 E(L(load_table3), X86_RET_UNUSED15)
565 ENDF(C(ffi_closure_STDCALL))
569 #define raw_closure_S_FS (16+16+12)
572 .globl C(ffi_closure_raw_SYSV)
573 FFI_HIDDEN(C(ffi_closure_raw_SYSV))
574 C(ffi_closure_raw_SYSV):
577 subl $raw_closure_S_FS, %esp
579 # cfi_def_cfa_offset(raw_closure_S_FS + 4)
580 movl %ebx, raw_closure_S_FS-4(%esp)
582 # cfi_rel_offset(%ebx, raw_closure_S_FS-4)
584 movl FFI_TRAMPOLINE_SIZE+8(%eax), %edx /* load cl->user_data */
586 leal raw_closure_S_FS+4(%esp), %edx /* load raw_args */
588 leal 16(%esp), %edx /* load &res */
590 movl FFI_TRAMPOLINE_SIZE(%eax), %ebx /* load cl->cif */
592 call *FFI_TRAMPOLINE_SIZE+4(%eax) /* call cl->fun */
594 movl 20(%ebx), %eax /* load cif->flags */
595 andl $X86_RET_TYPE_MASK, %eax
597 call C(__x86.get_pc_thunk.bx)
599 leal L(load_table4)-L(pc4)(%ebx, %eax, 8), %ecx
601 leal L(load_table4)(,%eax, 8), %ecx
603 movl raw_closure_S_FS-4(%esp), %ebx
606 movl 16(%esp), %eax /* Optimistic load */
611 E(L(load_table4), X86_RET_FLOAT)
614 E(L(load_table4), X86_RET_DOUBLE)
617 E(L(load_table4), X86_RET_LDOUBLE)
620 E(L(load_table4), X86_RET_SINT8)
623 E(L(load_table4), X86_RET_SINT16)
626 E(L(load_table4), X86_RET_UINT8)
629 E(L(load_table4), X86_RET_UINT16)
632 E(L(load_table4), X86_RET_INT64)
633 movl 16+4(%esp), %edx
635 E(L(load_table4), X86_RET_INT32)
638 E(L(load_table4), X86_RET_VOID)
640 addl $raw_closure_S_FS, %esp
642 # cfi_adjust_cfa_offset(-raw_closure_S_FS)
645 # cfi_adjust_cfa_offset(raw_closure_S_FS)
646 E(L(load_table4), X86_RET_STRUCTPOP)
647 addl $raw_closure_S_FS, %esp
649 # cfi_adjust_cfa_offset(-raw_closure_S_FS)
652 # cfi_adjust_cfa_offset(raw_closure_S_FS)
653 E(L(load_table4), X86_RET_STRUCTARG)
655 E(L(load_table4), X86_RET_STRUCT_1B)
658 E(L(load_table4), X86_RET_STRUCT_2B)
662 /* Fill out the table so that bad values are predictable. */
663 E(L(load_table4), X86_RET_UNUSED14)
665 E(L(load_table4), X86_RET_UNUSED15)
670 ENDF(C(ffi_closure_raw_SYSV))
672 #define raw_closure_T_FS (16+16+8)
675 .globl C(ffi_closure_raw_THISCALL)
676 FFI_HIDDEN(C(ffi_closure_raw_THISCALL))
677 C(ffi_closure_raw_THISCALL):
680 /* Rearrange the stack such that %ecx is the first argument.
681 This means moving the return address. */
684 # cfi_def_cfa_offset(0)
685 # cfi_register(%eip, %edx)
688 # cfi_adjust_cfa_offset(4)
691 # cfi_adjust_cfa_offset(4)
692 # cfi_rel_offset(%eip, 0)
693 subl $raw_closure_T_FS, %esp
695 # cfi_adjust_cfa_offset(raw_closure_T_FS)
696 movl %ebx, raw_closure_T_FS-4(%esp)
698 # cfi_rel_offset(%ebx, raw_closure_T_FS-4)
700 movl FFI_TRAMPOLINE_SIZE+8(%eax), %edx /* load cl->user_data */
702 leal raw_closure_T_FS+4(%esp), %edx /* load raw_args */
704 leal 16(%esp), %edx /* load &res */
706 movl FFI_TRAMPOLINE_SIZE(%eax), %ebx /* load cl->cif */
708 call *FFI_TRAMPOLINE_SIZE+4(%eax) /* call cl->fun */
710 movl 20(%ebx), %eax /* load cif->flags */
711 andl $X86_RET_TYPE_MASK, %eax
713 call C(__x86.get_pc_thunk.bx)
715 leal L(load_table5)-L(pc5)(%ebx, %eax, 8), %ecx
717 leal L(load_table5)(,%eax, 8), %ecx
719 movl raw_closure_T_FS-4(%esp), %ebx
722 movl 16(%esp), %eax /* Optimistic load */
727 E(L(load_table5), X86_RET_FLOAT)
730 E(L(load_table5), X86_RET_DOUBLE)
733 E(L(load_table5), X86_RET_LDOUBLE)
736 E(L(load_table5), X86_RET_SINT8)
739 E(L(load_table5), X86_RET_SINT16)
742 E(L(load_table5), X86_RET_UINT8)
745 E(L(load_table5), X86_RET_UINT16)
748 E(L(load_table5), X86_RET_INT64)
749 movl 16+4(%esp), %edx
751 E(L(load_table5), X86_RET_INT32)
754 E(L(load_table5), X86_RET_VOID)
756 addl $raw_closure_T_FS, %esp
758 # cfi_adjust_cfa_offset(-raw_closure_T_FS)
759 /* Remove the extra %ecx argument we pushed. */
762 # cfi_adjust_cfa_offset(raw_closure_T_FS)
763 E(L(load_table5), X86_RET_STRUCTPOP)
764 addl $raw_closure_T_FS, %esp
766 # cfi_adjust_cfa_offset(-raw_closure_T_FS)
769 # cfi_adjust_cfa_offset(raw_closure_T_FS)
770 E(L(load_table5), X86_RET_STRUCTARG)
772 E(L(load_table5), X86_RET_STRUCT_1B)
775 E(L(load_table5), X86_RET_STRUCT_2B)
779 /* Fill out the table so that bad values are predictable. */
780 E(L(load_table5), X86_RET_UNUSED14)
782 E(L(load_table5), X86_RET_UNUSED15)
787 ENDF(C(ffi_closure_raw_THISCALL))
789 #endif /* !FFI_NO_RAW_API */
793 .section __TEXT,__textcoal_nt,coalesced,pure_instructions; \
794 .weak_definition X; \
796 #elif defined __ELF__ && !(defined(__sun__) && defined(__svr4__))
798 .section .text.X,"axG",@progbits,X,comdat; \
806 COMDAT(C(__x86.get_pc_thunk.bx))
807 C(__x86.get_pc_thunk.bx):
810 ENDF(C(__x86.get_pc_thunk.bx))
811 # if defined X86_DARWIN || defined HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
812 COMDAT(C(__x86.get_pc_thunk.dx))
813 C(__x86.get_pc_thunk.dx):
816 ENDF(C(__x86.get_pc_thunk.dx))
817 #endif /* DARWIN || HIDDEN */
820 /* Sadly, OSX cctools-as doesn't understand .cfi directives at all. */
823 .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
825 #elif defined(X86_WIN32)
826 .section .eh_frame,"r"
827 #elif defined(HAVE_AS_X86_64_UNWIND_SECTION_TYPE)
828 .section .eh_frame,EH_FRAME_FLAGS,@unwind
830 .section .eh_frame,EH_FRAME_FLAGS,@progbits
833 #ifdef HAVE_AS_X86_PCREL
834 # define PCREL(X) X - .
836 # define PCREL(X) X@rel
839 /* Simplify advancing between labels. Assume DW_CFA_advance_loc1 fits. */
840 #define ADV(N, P) .byte 2, L(N)-L(P)
844 .set L(set0),L(ECIE)-L(SCIE)
845 .long L(set0) /* CIE Length */
847 .long 0 /* CIE Identifier Tag */
848 .byte 1 /* CIE Version */
849 .ascii "zR\0" /* CIE Augmentation */
850 .byte 1 /* CIE Code Alignment Factor */
851 .byte 0x7c /* CIE Data Alignment Factor */
852 .byte 0x8 /* CIE RA Column */
853 .byte 1 /* Augmentation size */
854 .byte 0x1b /* FDE Encoding (pcrel sdata4) */
855 .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp offset 4 */
856 .byte 0x80+8, 1 /* DW_CFA_offset, %eip offset 1*-4 */
860 .set L(set1),L(EFDE1)-L(SFDE1)
861 .long L(set1) /* FDE Length */
863 .long L(SFDE1)-L(CIE) /* FDE CIE offset */
864 .long PCREL(L(UW0)) /* Initial location */
865 .long L(UW5)-L(UW0) /* Address range */
866 .byte 0 /* Augmentation size */
868 .byte 0xc, 5, 8 /* DW_CFA_def_cfa, %ebp 8 */
869 .byte 0x80+5, 2 /* DW_CFA_offset, %ebp 2*-4 */
871 .byte 0x80+3, 0 /* DW_CFA_offset, %ebx 0*-4 */
873 .byte 0xa /* DW_CFA_remember_state */
874 .byte 0xc, 4, 4 /* DW_CFA_def_cfa, %esp 4 */
875 .byte 0xc0+3 /* DW_CFA_restore, %ebx */
876 .byte 0xc0+5 /* DW_CFA_restore, %ebp */
878 .byte 0xb /* DW_CFA_restore_state */
882 .set L(set2),L(EFDE2)-L(SFDE2)
883 .long L(set2) /* FDE Length */
885 .long L(SFDE2)-L(CIE) /* FDE CIE offset */
886 .long PCREL(L(UW6)) /* Initial location */
887 .long L(UW8)-L(UW6) /* Address range */
888 .byte 0 /* Augmentation size */
890 .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
894 .set L(set3),L(EFDE3)-L(SFDE3)
895 .long L(set3) /* FDE Length */
897 .long L(SFDE3)-L(CIE) /* FDE CIE offset */
898 .long PCREL(L(UW9)) /* Initial location */
899 .long L(UW11)-L(UW9) /* Address range */
900 .byte 0 /* Augmentation size */
902 .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
906 .set L(set4),L(EFDE4)-L(SFDE4)
907 .long L(set4) /* FDE Length */
909 .long L(SFDE4)-L(CIE) /* FDE CIE offset */
910 .long PCREL(L(UW12)) /* Initial location */
911 .long L(UW20)-L(UW12) /* Address range */
912 .byte 0 /* Augmentation size */
914 .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
915 #ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX
917 .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */
919 .byte 0xc0+3 /* DW_CFA_restore %ebx */
924 .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
926 .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
928 .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
930 .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
934 .set L(set5),L(EFDE5)-L(SFDE5)
935 .long L(set5) /* FDE Length */
937 .long L(SFDE5)-L(CIE) /* FDE CIE offset */
938 .long PCREL(L(UW21)) /* Initial location */
939 .long L(UW23)-L(UW21) /* Address range */
940 .byte 0 /* Augmentation size */
942 .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
946 .set L(set6),L(EFDE6)-L(SFDE6)
947 .long L(set6) /* FDE Length */
949 .long L(SFDE6)-L(CIE) /* FDE CIE offset */
950 .long PCREL(L(UW24)) /* Initial location */
951 .long L(UW26)-L(UW24) /* Address range */
952 .byte 0 /* Augmentation size */
953 .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
954 .byte 0x80+8, 2 /* DW_CFA_offset %eip, 2*-4 */
956 .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
960 .set L(set7),L(EFDE7)-L(SFDE7)
961 .long L(set7) /* FDE Length */
963 .long L(SFDE7)-L(CIE) /* FDE CIE offset */
964 .long PCREL(L(UW27)) /* Initial location */
965 .long L(UW31)-L(UW27) /* Address range */
966 .byte 0 /* Augmentation size */
968 .byte 0xe, closure_FS+4 /* DW_CFA_def_cfa_offset */
969 #ifdef FFI_CLOSURE_CALL_INNER_SAVE_EBX
971 .byte 0x80+3, (40-(closure_FS+4))/-4 /* DW_CFA_offset %ebx */
973 .byte 0xc0+3 /* DW_CFA_restore %ebx */
979 .set L(set8),L(EFDE8)-L(SFDE8)
980 .long L(set8) /* FDE Length */
982 .long L(SFDE8)-L(CIE) /* FDE CIE offset */
983 .long PCREL(L(UW32)) /* Initial location */
984 .long L(UW40)-L(UW32) /* Address range */
985 .byte 0 /* Augmentation size */
987 .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
989 .byte 0x80+3, 2 /* DW_CFA_offset %ebx 2*-4 */
991 .byte 0xc0+3 /* DW_CFA_restore %ebx */
993 .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
995 .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
997 .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
999 .byte 0xe, raw_closure_S_FS+4 /* DW_CFA_def_cfa_offset */
1003 .set L(set9),L(EFDE9)-L(SFDE9)
1004 .long L(set9) /* FDE Length */
1006 .long L(SFDE9)-L(CIE) /* FDE CIE offset */
1007 .long PCREL(L(UW41)) /* Initial location */
1008 .long L(UW52)-L(UW41) /* Address range */
1009 .byte 0 /* Augmentation size */
1011 .byte 0xe, 0 /* DW_CFA_def_cfa_offset */
1012 .byte 0x9, 8, 2 /* DW_CFA_register %eip, %edx */
1014 .byte 0xe, 4 /* DW_CFA_def_cfa_offset */
1016 .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
1017 .byte 0x80+8, 2 /* DW_CFA_offset %eip 2*-4 */
1019 .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
1021 .byte 0x80+3, 3 /* DW_CFA_offset %ebx 3*-4 */
1023 .byte 0xc0+3 /* DW_CFA_restore %ebx */
1025 .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
1027 .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
1029 .byte 0xe, 8 /* DW_CFA_def_cfa_offset */
1031 .byte 0xe, raw_closure_T_FS+8 /* DW_CFA_def_cfa_offset */
1034 #endif /* !FFI_NO_RAW_API */
1036 #endif /* ifndef __x86_64__ */
1038 #if defined __ELF__ && defined __linux__
1039 .section .note.GNU-stack,"",@progbits