Skip to content

Commit 2061072

Browse files
committed
Don't mangle probes all the time
1 parent f9f6bd0 commit 2061072

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/probestack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#![cfg(not(windows))] // Windows already has builtins to do this
4545

4646
#[naked]
47-
#[no_mangle]
47+
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
4848
#[cfg(target_arch = "x86_64")]
4949
pub unsafe extern fn __rust_probestack() {
5050
// Our goal here is to touch each page between %rsp+8 and %rsp+8-%rax,
@@ -87,7 +87,7 @@ pub unsafe extern fn __rust_probestack() {
8787
}
8888

8989
#[naked]
90-
#[no_mangle]
90+
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
9191
#[cfg(target_arch = "x86")]
9292
pub unsafe extern fn __rust_probestack() {
9393
// This is the same as x86_64 above, only translated for 32-bit sizes. Note

src/x86_64.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use core::intrinsics;
1010

1111
#[cfg(windows)]
1212
#[naked]
13-
#[no_mangle]
13+
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
1414
pub unsafe fn ___chkstk_ms() {
1515
asm!("push %rcx
1616
push %rax
@@ -34,7 +34,7 @@ pub unsafe fn ___chkstk_ms() {
3434

3535
#[cfg(windows)]
3636
#[naked]
37-
#[no_mangle]
37+
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
3838
pub unsafe fn __alloca() {
3939
asm!("mov %rcx,%rax // x64 _alloca is a normal function with parameter in rcx
4040
jmp ___chkstk // Jump to ___chkstk since fallthrough may be unreliable");
@@ -43,7 +43,7 @@ pub unsafe fn __alloca() {
4343

4444
#[cfg(windows)]
4545
#[naked]
46-
#[no_mangle]
46+
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
4747
pub unsafe fn ___chkstk() {
4848
asm!("push %rcx
4949
cmp $$0x1000,%rax

0 commit comments

Comments
 (0)