Skip to content

Commit a090b93

Browse files
committed
Use #[rustc_std_internal_symbol] instead of #[no_mangle]
1 parent 2acb46c commit a090b93

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

src/libpanic_abort/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub unsafe extern "C" fn __rust_start_panic(_payload: usize) -> u32 {
8989
// binaries, but it should never be called as we don't link in an unwinding
9090
// runtime at all.
9191
pub mod personalities {
92-
#[no_mangle]
92+
#[rustc_std_internal_symbol]
9393
#[cfg(not(any(
9494
all(target_arch = "wasm32", not(target_os = "emscripten"),),
9595
all(target_os = "windows", target_env = "gnu", target_arch = "x86_64",),
@@ -98,7 +98,7 @@ pub mod personalities {
9898

9999
// On x86_64-pc-windows-gnu we use our own personality function that needs
100100
// to return `ExceptionContinueSearch` as we're passing on all our frames.
101-
#[no_mangle]
101+
#[rustc_std_internal_symbol]
102102
#[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86_64"))]
103103
pub extern "C" fn rust_eh_personality(
104104
_record: usize,
@@ -114,16 +114,16 @@ pub mod personalities {
114114
//
115115
// Note that we don't execute landing pads, so this is never called, so it's
116116
// body is empty.
117-
#[no_mangle]
117+
#[rustc_std_internal_symbol]
118118
#[cfg(all(target_os = "windows", target_env = "gnu"))]
119119
pub extern "C" fn rust_eh_unwind_resume() {}
120120

121121
// These two are called by our startup objects on i686-pc-windows-gnu, but
122122
// they don't need to do anything so the bodies are nops.
123-
#[no_mangle]
123+
#[rustc_std_internal_symbol]
124124
#[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86"))]
125125
pub extern "C" fn rust_eh_register_frames() {}
126-
#[no_mangle]
126+
#[rustc_std_internal_symbol]
127127
#[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86"))]
128128
pub extern "C" fn rust_eh_unregister_frames() {}
129129
}

src/libpanic_unwind/emcc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ extern "C" fn exception_cleanup(ptr: *mut libc::c_void) -> DestructorRet {
9494
}
9595

9696
#[lang = "eh_personality"]
97-
#[no_mangle]
9897
unsafe extern "C" fn rust_eh_personality(
9998
version: c_int,
10099
actions: uw::_Unwind_Action,

src/libpanic_unwind/gcc.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ cfg_if::cfg_if! {
138138
//
139139
// iOS uses the default routine instead since it uses SjLj unwinding.
140140
#[lang = "eh_personality"]
141-
#[no_mangle]
142141
unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
143142
exception_object: *mut uw::_Unwind_Exception,
144143
context: *mut uw::_Unwind_Context)
@@ -272,7 +271,6 @@ cfg_if::cfg_if! {
272271
// On x86_64 MinGW targets, the unwinding mechanism is SEH however the unwind
273272
// handler data (aka LSDA) uses GCC-compatible encoding.
274273
#[lang = "eh_personality"]
275-
#[no_mangle]
276274
#[allow(nonstandard_style)]
277275
unsafe extern "C" fn rust_eh_personality(exceptionRecord: *mut uw::EXCEPTION_RECORD,
278276
establisherFrame: uw::LPVOID,
@@ -288,7 +286,6 @@ cfg_if::cfg_if! {
288286
} else {
289287
// The personality routine for most of our targets.
290288
#[lang = "eh_personality"]
291-
#[no_mangle]
292289
unsafe extern "C" fn rust_eh_personality(version: c_int,
293290
actions: uw::_Unwind_Action,
294291
exception_class: uw::_Unwind_Exception_Class,
@@ -382,12 +379,12 @@ pub mod eh_frame_registry {
382379
fn __deregister_frame_info(eh_frame_begin: *const u8, object: *mut u8);
383380
}
384381

385-
#[no_mangle]
382+
#[rustc_std_internal_symbol]
386383
pub unsafe extern "C" fn rust_eh_register_frames(eh_frame_begin: *const u8, object: *mut u8) {
387384
__register_frame_info(eh_frame_begin, object);
388385
}
389386

390-
#[no_mangle]
387+
#[rustc_std_internal_symbol]
391388
pub unsafe extern "C" fn rust_eh_unregister_frames(eh_frame_begin: *const u8, object: *mut u8) {
392389
__deregister_frame_info(eh_frame_begin, object);
393390
}

src/libpanic_unwind/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ extern "C" {
7373

7474
mod dwarf;
7575

76-
#[no_mangle]
76+
#[rustc_std_internal_symbol]
7777
pub unsafe extern "C" fn __rust_panic_cleanup(
7878
payload: TryPayload,
7979
) -> *mut (dyn Any + Send + 'static) {
@@ -82,7 +82,7 @@ pub unsafe extern "C" fn __rust_panic_cleanup(
8282

8383
// Entry point for raising an exception, just delegates to the platform-specific
8484
// implementation.
85-
#[no_mangle]
85+
#[rustc_std_internal_symbol]
8686
#[unwind(allowed)]
8787
pub unsafe extern "C" fn __rust_start_panic(payload: usize) -> u32 {
8888
let payload = payload as *mut &mut dyn BoxMeUp;

0 commit comments

Comments
 (0)