File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 43
43
44
44
#![ cfg( not( windows) ) ] // Windows already has builtins to do this
45
45
46
+ extern "C" {
47
+ pub fn __rust_probestack ( ) ;
48
+ }
49
+
46
50
#[ naked]
47
51
#[ no_mangle]
48
52
#[ cfg( all( target_arch = "x86_64" , not( feature = "mangled-names" ) ) ) ]
49
- pub unsafe extern "C" fn __rust_probestack ( ) {
53
+ pub unsafe extern "C" fn __rust_probestack_wrapper ( ) {
50
54
// Our goal here is to touch each page between %rsp+8 and %rsp+8-%rax,
51
55
// ensuring that if any pages are unmapped we'll make a page fault.
52
56
//
53
57
// The ABI here is that the stack frame size is located in `%eax`. Upon
54
58
// return we're not supposed to modify `%esp` or `%eax`.
55
59
asm ! ( "
60
+ .cfi_endproc
61
+ .pushsection .text.__rust_probestack
62
+ .p2align 4,,15
63
+ .globl __rust_probestack
64
+ .type __rust_probestack, @function
65
+ __rust_probestack:
66
+ .cfi_startproc
56
67
pushq %rbp
68
+ .cfi_def_cfa_offset 16
69
+ .cfi_offset rbp, -16
57
70
movq %rsp, %rbp
71
+ .cfi_def_cfa_register rbp
58
72
59
73
mov %rax,%r11 // duplicate %rax as we're clobbering %r11
60
74
@@ -93,7 +107,13 @@ pub unsafe extern "C" fn __rust_probestack() {
93
107
add %rax,%rsp
94
108
95
109
leave
110
+ .cfi_def_cfa rsp, 8
96
111
ret
112
+ .cfi_endproc
113
+
114
+ .size __rust_probestack, . - __rust_probestack
115
+ .popsection
116
+ .cfi_startproc
97
117
" :: : "memory" : "volatile" ) ;
98
118
:: core:: intrinsics:: unreachable ( ) ;
99
119
}
You can’t perform that action at this time.
0 commit comments