File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 4343
4444#![ cfg( not( windows) ) ] // Windows already has builtins to do this
4545
46+ extern "C" {
47+ pub fn __rust_probestack ( ) ;
48+ }
49+
4650#[ naked]
4751#[ no_mangle]
4852#[ 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 ( ) {
5054 // Our goal here is to touch each page between %rsp+8 and %rsp+8-%rax,
5155 // ensuring that if any pages are unmapped we'll make a page fault.
5256 //
5357 // The ABI here is that the stack frame size is located in `%eax`. Upon
5458 // return we're not supposed to modify `%esp` or `%eax`.
5559 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
5667 pushq %rbp
68+ .cfi_def_cfa_offset 16
69+ .cfi_offset rbp, -16
5770 movq %rsp, %rbp
71+ .cfi_def_cfa_register rbp
5872
5973 mov %rax,%r11 // duplicate %rax as we're clobbering %r11
6074
@@ -93,7 +107,13 @@ pub unsafe extern "C" fn __rust_probestack() {
93107 add %rax,%rsp
94108
95109 leave
110+ .cfi_def_cfa rsp, 8
96111 ret
112+ .cfi_endproc
113+
114+ .size __rust_probestack, . - __rust_probestack
115+ .popsection
116+ .cfi_startproc
97117 " :: : "memory" : "volatile" ) ;
98118 :: core:: intrinsics:: unreachable ( ) ;
99119}
You can’t perform that action at this time.
0 commit comments