1
Fork 0

Use #[rustc_std_internal_symbol] instead of #[no_mangle]

This commit is contained in:
Amanieu d'Antras 2020-03-02 11:57:30 +00:00
parent f4f91f0b2f
commit 5953c100d1
4 changed files with 9 additions and 13 deletions

View file

@ -89,7 +89,7 @@ pub unsafe extern "C" fn __rust_start_panic(_payload: usize) -> u32 {
// binaries, but it should never be called as we don't link in an unwinding
// runtime at all.
pub mod personalities {
#[no_mangle]
#[rustc_std_internal_symbol]
#[cfg(not(any(
all(target_arch = "wasm32", not(target_os = "emscripten"),),
all(target_os = "windows", target_env = "gnu", target_arch = "x86_64",),
@ -98,7 +98,7 @@ pub mod personalities {
// On x86_64-pc-windows-gnu we use our own personality function that needs
// to return `ExceptionContinueSearch` as we're passing on all our frames.
#[no_mangle]
#[rustc_std_internal_symbol]
#[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86_64"))]
pub extern "C" fn rust_eh_personality(
_record: usize,
@ -114,16 +114,16 @@ pub mod personalities {
//
// Note that we don't execute landing pads, so this is never called, so it's
// body is empty.
#[no_mangle]
#[rustc_std_internal_symbol]
#[cfg(all(bootstrap, target_os = "windows", target_env = "gnu"))]
pub extern "C" fn rust_eh_unwind_resume() {}
// These two are called by our startup objects on i686-pc-windows-gnu, but
// they don't need to do anything so the bodies are nops.
#[no_mangle]
#[rustc_std_internal_symbol]
#[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86"))]
pub extern "C" fn rust_eh_register_frames() {}
#[no_mangle]
#[rustc_std_internal_symbol]
#[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86"))]
pub extern "C" fn rust_eh_unregister_frames() {}
}

View file

@ -94,7 +94,6 @@ extern "C" fn exception_cleanup(ptr: *mut libc::c_void) -> DestructorRet {
}
#[lang = "eh_personality"]
#[no_mangle]
unsafe extern "C" fn rust_eh_personality(
version: c_int,
actions: uw::_Unwind_Action,

View file

@ -130,7 +130,6 @@ cfg_if::cfg_if! {
//
// iOS uses the default routine instead since it uses SjLj unwinding.
#[lang = "eh_personality"]
#[no_mangle]
unsafe extern "C" fn rust_eh_personality(state: uw::_Unwind_State,
exception_object: *mut uw::_Unwind_Exception,
context: *mut uw::_Unwind_Context)
@ -264,7 +263,6 @@ cfg_if::cfg_if! {
// On x86_64 MinGW targets, the unwinding mechanism is SEH however the unwind
// handler data (aka LSDA) uses GCC-compatible encoding.
#[lang = "eh_personality"]
#[no_mangle]
#[allow(nonstandard_style)]
unsafe extern "C" fn rust_eh_personality(exceptionRecord: *mut uw::EXCEPTION_RECORD,
establisherFrame: uw::LPVOID,
@ -280,7 +278,6 @@ cfg_if::cfg_if! {
} else {
// The personality routine for most of our targets.
#[lang = "eh_personality"]
#[no_mangle]
unsafe extern "C" fn rust_eh_personality(version: c_int,
actions: uw::_Unwind_Action,
exception_class: uw::_Unwind_Exception_Class,
@ -351,12 +348,12 @@ pub mod eh_frame_registry {
fn __deregister_frame_info(eh_frame_begin: *const u8, object: *mut u8);
}
#[no_mangle]
#[rustc_std_internal_symbol]
pub unsafe extern "C" fn rust_eh_register_frames(eh_frame_begin: *const u8, object: *mut u8) {
__register_frame_info(eh_frame_begin, object);
}
#[no_mangle]
#[rustc_std_internal_symbol]
pub unsafe extern "C" fn rust_eh_unregister_frames(eh_frame_begin: *const u8, object: *mut u8) {
__deregister_frame_info(eh_frame_begin, object);
}

View file

@ -72,7 +72,7 @@ extern "C" {
mod dwarf;
#[no_mangle]
#[rustc_std_internal_symbol]
pub unsafe extern "C" fn __rust_panic_cleanup(
payload: TryPayload,
) -> *mut (dyn Any + Send + 'static) {
@ -81,7 +81,7 @@ pub unsafe extern "C" fn __rust_panic_cleanup(
// Entry point for raising an exception, just delegates to the platform-specific
// implementation.
#[no_mangle]
#[rustc_std_internal_symbol]
#[unwind(allowed)]
pub unsafe extern "C" fn __rust_start_panic(payload: usize) -> u32 {
let payload = payload as *mut &mut dyn BoxMeUp;