1 /* Copyright 2013 The Go Authors. All rights reserved.
2 Use of this source code is governed by a BSD-style
3 license that can be found in the LICENSE file.
5 MakeFunc 386 assembly code. */
9 .globl reflect.makeFuncStub
12 .type reflect.makeFuncStub,@function
18 /* Go does not provide any equivalent to the regparm function
19 attribute, so on Go we do not need to worry about passing
20 parameters in registers. We just pass a pointer to the
21 arguments on the stack.
23 We do need to pick up the return values, though, so we pass
24 a pointer to a struct that looks like this.
32 The sr field is set by the function to a non-zero value if
33 the function takes a struct hidden pointer that must be
34 popped off the stack. */
40 pushl %ebx /* In case this is PIC. */
41 subl $36, %esp /* Enough for args and to align stack. */
45 call __x86.get_pc_thunk.bx
46 addl $_GLOBAL_OFFSET_TABLE_, %ebx
49 leal 8(%ebp), %eax /* Set esp field in struct. */
52 /* For MakeFunc functions that call recover. */
56 call __go_makefunc_can_recover@PLT
58 call __go_makefunc_can_recover
62 call __go_get_closure@PLT
73 call reflect.MakeFuncStubGo@PLT
75 call reflect.MakeFuncStubGo
78 /* MakeFunc functions can no longer call recover. */
80 call __go_makefunc_returning@PLT
82 call __go_makefunc_returning
85 /* Set return registers. */
95 /* In case we are compiling with -msseregparm. This won't work
96 correctly if only SSE1 is supported, but that seems unlikely. */
97 movsd -16(%ebp), %xmm0
116 .size reflect.makeFuncStub, . - reflect.makeFuncStub
120 #ifdef HAVE_AS_COMDAT_GAS
121 .section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
123 /* Sun as needs a different syntax. */
124 .section .text.__x86.get_pc_thunk.bx%__x86.get_pc_thunk.bx,"ax",@progbits
125 .group __x86.get_pc_thunk.bx,.text.__x86.get_pc_thunk.bx%__x86.get_pc_thunk.bx,#comdat
127 .globl __x86.get_pc_thunk.bx
128 .hidden __x86.get_pc_thunk.bx
130 .type __x86.get_pc_thunk.bx, @function
132 __x86.get_pc_thunk.bx:
138 .size __x86.get_pc_thunk.bx, . - __x86.get_pc_thunk.bx
144 # if defined __sun__ && defined __svr4__
145 /* 32-bit Solaris 2/x86 uses datarel encoding for PIC. GNU ld before 2.22
146 doesn't correctly sort .eh_frame_hdr with mixed encodings, so match this. */
147 # define FDE_ENCODING 0x30 /* datarel */
148 # define FDE_ENCODE(X) X@GOTOFF
150 # define FDE_ENCODING 0x1b /* pcrel sdata4 */
151 # if defined HAVE_AS_X86_PCREL
152 # define FDE_ENCODE(X) X-.
154 # define FDE_ENCODE(X) X@rel
158 # define FDE_ENCODING 0 /* absolute */
159 # define FDE_ENCODE(X) X
162 .section .eh_frame,EH_FRAME_FLAGS,@progbits
164 .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */
166 .long 0x0 /* CIE Identifier Tag */
167 .byte 0x1 /* CIE Version */
168 .ascii "zR\0" /* CIE Augmentation */
169 .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */
170 .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */
171 .byte 0x8 /* CIE RA Column */
172 .byte 0x1 /* .uleb128 0x1; Augmentation size */
174 .byte 0xc /* DW_CFA_def_cfa */
175 .byte 0x4 /* .uleb128 0x4 */
176 .byte 0x4 /* .uleb128 0x4 */
177 .byte 0x88 /* DW_CFA_offset, column 0x8 */
178 .byte 0x1 /* .uleb128 0x1 */
182 .long .LEFDE1-.LASFDE1 /* FDE Length */
184 .long .LASFDE1-.Lframe1 /* FDE CIE offset */
185 .long FDE_ENCODE(.LFB1) /* FDE initial location */
186 .long .LFE1-.LFB1 /* FDE address range */
187 .byte 0x0 /* .uleb128 0x0; Augmentation size */
188 .byte 0x4 /* DW_CFA_advance_loc4 */
190 .byte 0xe /* DW_CFA_def_cfa_offset */
191 .byte 0x8 /* .uleb128 0x8 */
192 .byte 0x85 /* DW_CFA_offset, column 0x5 */
193 .byte 0x2 /* .uleb128 0x2 */
194 .byte 0x4 /* DW_CFA_advance_loc4 */
196 .byte 0xd /* DW_CFA_def_cfa_register */
197 .byte 0x5 /* .uleb128 0x5 */
198 .byte 0x4 /* DW_CFA_advance_loc4 */
200 .byte 0x83 /* .DW_CFA_offset, column 0x3 */
201 .byte 0x3 /* .uleb128 0x3 */
202 .byte 0x4 /* DW_CFA_advance_loc4 */
204 .byte 0xc3 /* DW_CFA_restore, column 0x3 */
205 .byte 0x4 /* DW_CFA_advance_loc4 */
207 .byte 0xc5 /* DW_CFA_restore, column 0x5 */
208 .byte 0xc /* DW_CFA_def_cfa */
209 .byte 0x4 /* .uleb128 0x4 */
210 .byte 0x4 /* .uleb128 0x4 */
215 .long .LEFDE2-.LASFDE2 /* FDE Length */
217 .long .LASFDE2-.Lframe1 /* FDE CIE offset */
218 .long FDE_ENCODE(.LFB2) /* FDE initial location */
219 .long .LFE2-.LFB2 /* FDE address range */
220 .byte 0x0 /* .uleb128 0x0; Augmentation size */
226 #if defined(__ELF__) && defined(__linux__)
227 .section .note.GNU-stack,"",@progbits
228 .section .note.GNU-split-stack,"",@progbits
229 .section .note.GNU-no-split-stack,"",@progbits