Skip to content

Commit 5953c10

Browse files
committed
Use #[rustc_std_internal_symbol] instead of #[no_mangle]
1 parent f4f91f0 commit 5953c10

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(bootstrap, 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
@@ -130,7 +130,6 @@ cfg_if::cfg_if! {
130130
//
131131
// iOS uses the default routine instead since it uses SjLj unwinding.
132132
#[lang = "eh_personality"]
133-
#[no_mangle]
134133
unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
135134
exception_object: *mut uw::_Unwind_Exception,
136135
context: *mut uw::_Unwind_Context)
@@ -264,7 +263,6 @@ cfg_if::cfg_if! {
264263
// On x86_64 MinGW targets, the unwinding mechanism is SEH however the unwind
265264
// handler data (aka LSDA) uses GCC-compatible encoding.
266265
#[lang = "eh_personality"]
267-
#[no_mangle]
268266
#[allow(nonstandard_style)]
269267
unsafe extern "C" fn rust_eh_personality(exceptionRecord: *mut uw::EXCEPTION_RECORD,
270268
establisherFrame: uw::LPVOID,
@@ -280,7 +278,6 @@ cfg_if::cfg_if! {
280278
} else {
281279
// The personality routine for most of our targets.
282280
#[lang = "eh_personality"]
283-
#[no_mangle]
284281
unsafe extern "C" fn rust_eh_personality(version: c_int,
285282
actions: uw::_Unwind_Action,
286283
exception_class: uw::_Unwind_Exception_Class,
@@ -351,12 +348,12 @@ pub mod eh_frame_registry {
351348
fn __deregister_frame_info(eh_frame_begin: *const u8, object: *mut u8);
352349
}
353350

354-
#[no_mangle]
351+
#[rustc_std_internal_symbol]
355352
pub unsafe extern "C" fn rust_eh_register_frames(eh_frame_begin: *const u8, object: *mut u8) {
356353
__register_frame_info(eh_frame_begin, object);
357354
}
358355

359-
#[no_mangle]
356+
#[rustc_std_internal_symbol]
360357
pub unsafe extern "C" fn rust_eh_unregister_frames(eh_frame_begin: *const u8, object: *mut u8) {
361358
__deregister_frame_info(eh_frame_begin, object);
362359
}

src/libpanic_unwind/lib.rs

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

7373
mod dwarf;
7474

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

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

0 commit comments

Comments
 (0)