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.
36 pushl %ebx /* In case this is PIC. */
37 subl $36, %esp /* Enough for args and to align stack. */
41 call __x86.get_pc_thunk.bx
42 addl $_GLOBAL_OFFSET_TABLE_, %ebx
45 leal 8(%ebp), %eax /* Set esp field in struct. */
49 call __go_get_closure@PLT
60 call reflect.MakeFuncStubGo@PLT
62 call reflect.MakeFuncStubGo
65 /* Set return registers. */
71 /* In case we are compiling with -msseregparm. This won't work
72 correctly if only SSE1 is supported, but that seems unlikely. */
73 movsd -16(%ebp), %xmm0
84 .size reflect.makeFuncStub, . - reflect.makeFuncStub
88 #ifdef HAVE_AS_COMDAT_GAS
89 .section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
91 /* Sun as needs a different syntax. */
92 .section .text.__x86.get_pc_thunk.bx%__x86.get_pc_thunk.bx,"ax",@progbits
93 .group __x86.get_pc_thunk.bx,.text.__x86.get_pc_thunk.bx%__x86.get_pc_thunk.bx,#comdat
95 .globl __x86.get_pc_thunk.bx
96 .hidden __x86.get_pc_thunk.bx
98 .type __x86.get_pc_thunk.bx, @function
100 __x86.get_pc_thunk.bx:
106 .size __x86.get_pc_thunk.bx, . - __x86.get_pc_thunk.bx
112 # if defined __sun__ && defined __svr4__
113 /* 32-bit Solaris 2/x86 uses datarel encoding for PIC. GNU ld before 2.22
114 doesn't correctly sort .eh_frame_hdr with mixed encodings, so match this. */
115 # define FDE_ENCODING 0x30 /* datarel */
116 # define FDE_ENCODE(X) X@GOTOFF
118 # define FDE_ENCODING 0x1b /* pcrel sdata4 */
119 # if defined HAVE_AS_X86_PCREL
120 # define FDE_ENCODE(X) X-.
122 # define FDE_ENCODE(X) X@rel
126 # define FDE_ENCODING 0 /* absolute */
127 # define FDE_ENCODE(X) X
130 .section .eh_frame,EH_FRAME_FLAGS,@progbits
132 .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */
134 .long 0x0 /* CIE Identifier Tag */
135 .byte 0x1 /* CIE Version */
136 .ascii "zR\0" /* CIE Augmentation */
137 .byte 0x1 /* .uleb128 0x1; CIE Code Alignment Factor */
138 .byte 0x7c /* .sleb128 -4; CIE Data Alignment Factor */
139 .byte 0x8 /* CIE RA Column */
140 .byte 0x1 /* .uleb128 0x1; Augmentation size */
142 .byte 0xc /* DW_CFA_def_cfa */
143 .byte 0x4 /* .uleb128 0x4 */
144 .byte 0x4 /* .uleb128 0x4 */
145 .byte 0x88 /* DW_CFA_offset, column 0x8 */
146 .byte 0x1 /* .uleb128 0x1 */
150 .long .LEFDE1-.LASFDE1 /* FDE Length */
152 .long .LASFDE1-.Lframe1 /* FDE CIE offset */
153 .long FDE_ENCODE(.LFB1) /* FDE initial location */
154 .long .LFE1-.LFB1 /* FDE address range */
155 .byte 0x0 /* .uleb128 0x0; Augmentation size */
156 .byte 0x4 /* DW_CFA_advance_loc4 */
158 .byte 0xe /* DW_CFA_def_cfa_offset */
159 .byte 0x8 /* .uleb128 0x8 */
160 .byte 0x85 /* DW_CFA_offset, column 0x5 */
161 .byte 0x2 /* .uleb128 0x2 */
162 .byte 0x4 /* DW_CFA_advance_loc4 */
164 .byte 0xd /* DW_CFA_def_cfa_register */
165 .byte 0x5 /* .uleb128 0x5 */
166 .byte 0x4 /* DW_CFA_advance_loc4 */
168 .byte 0x83 /* .DW_CFA_offset, column 0x3 */
169 .byte 0x3 /* .uleb128 0x3 */
170 .byte 0x4 /* DW_CFA_advance_loc4 */
172 .byte 0xc3 /* DW_CFA_restore, column 0x3 */
173 .byte 0x4 /* DW_CFA_advance_loc4 */
175 .byte 0xc5 /* DW_CFA_restore, column 0x5 */
176 .byte 0xc /* DW_CFA_def_cfa */
177 .byte 0x4 /* .uleb128 0x4 */
178 .byte 0x4 /* .uleb128 0x4 */
183 .long .LEFDE2-.LASFDE2 /* FDE Length */
185 .long .LASFDE2-.Lframe1 /* FDE CIE offset */
186 .long FDE_ENCODE(.LFB2) /* FDE initial location */
187 .long .LFE2-.LFB2 /* FDE address range */
188 .byte 0x0 /* .uleb128 0x0; Augmentation size */
194 #if defined(__ELF__) && defined(__linux__)
195 .section .note.GNU-stack,"",@progbits
196 .section .note.GNU-split-stack,"",@progbits
197 .section .note.GNU-no-split-stack,"",@progbits