about summary refs log tree commit diff
path: root/library/panic_unwind/src
diff options
context:
space:
mode:
authorAmanieu d'Antras <amanieu@gmail.com>2022-02-09 14:16:57 +0000
committerAmanieu d'Antras <amanieu@gmail.com>2022-08-23 16:12:58 +0800
commitc110329f25bf8c3103e5c5298775468df80c3517 (patch)
tree5188e1d2b7527c8ed352d2e98d2c6406347d7e3e /library/panic_unwind/src
parent5ff087669438ec406fd3abc99bd1b85b6fbe156a (diff)
Remove custom frame info registration on i686-pc-windows-gnu
The indirection is no longer needed since we always link to libgcc
even when the panic_abort runtime is used. Instead we can just call
the libgcc functions directly.
Diffstat (limited to 'library/panic_unwind/src')
-rw-r--r--library/panic_unwind/src/gcc.rs34
-rw-r--r--library/panic_unwind/src/lib.rs3
2 files changed, 0 insertions, 37 deletions
diff --git a/library/panic_unwind/src/gcc.rs b/library/panic_unwind/src/gcc.rs
index a5642178c8e..261404e8795 100644
--- a/library/panic_unwind/src/gcc.rs
+++ b/library/panic_unwind/src/gcc.rs
@@ -87,37 +87,3 @@ fn rust_exception_class() -> uw::_Unwind_Exception_Class {
     // M O Z \0  R U S T -- vendor, language
     0x4d4f5a_00_52555354
 }
-
-// Frame unwind info registration
-//
-// Each module's image contains a frame unwind info section (usually
-// ".eh_frame").  When a module is loaded/unloaded into the process, the
-// unwinder must be informed about the location of this section in memory. The
-// methods of achieving that vary by the platform.  On some (e.g., Linux), the
-// unwinder can discover unwind info sections on its own (by dynamically
-// enumerating currently loaded modules via the dl_iterate_phdr() API and
-// finding their ".eh_frame" sections); Others, like Windows, require modules
-// to actively register their unwind info sections via unwinder API.
-//
-// This module defines two symbols which are referenced and called from
-// rsbegin.rs to register our information with the GCC runtime. The
-// implementation of stack unwinding is (for now) deferred to libgcc_eh, however
-// Rust crates use these Rust-specific entry points to avoid potential clashes
-// with any GCC runtime.
-#[cfg(all(target_os = "windows", target_arch = "x86", target_env = "gnu"))]
-pub mod eh_frame_registry {
-    extern "C" {
-        fn __register_frame_info(eh_frame_begin: *const u8, object: *mut u8);
-        fn __deregister_frame_info(eh_frame_begin: *const u8, object: *mut u8);
-    }
-
-    #[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);
-    }
-
-    #[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);
-    }
-}
diff --git a/library/panic_unwind/src/lib.rs b/library/panic_unwind/src/lib.rs
index 55c3c90c428..1eb4f378904 100644
--- a/library/panic_unwind/src/lib.rs
+++ b/library/panic_unwind/src/lib.rs
@@ -52,9 +52,6 @@ cfg_if::cfg_if! {
         all(target_family = "unix", not(target_os = "espidf")),
         all(target_vendor = "fortanix", target_env = "sgx"),
     ))] {
-        // Rust runtime's startup objects depend on these symbols, so make them public.
-        #[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))]
-        pub use real_imp::eh_frame_registry::*;
         #[path = "gcc.rs"]
         mod real_imp;
     } else {