@@ -35,6 +35,16 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
3535 drop_in_place ( to_drop) ;
3636}
3737
38+ // Frame unwind info registration
39+ //
40+ // Each module's image contains a frame unwind info section (usually
41+ // ".eh_frame"). When a module is loaded/unloaded into the process, the
42+ // unwinder must be informed about the location of this section in memory. The
43+ // methods of achieving that vary by the platform. On some (e.g., Linux), the
44+ // unwinder can discover unwind info sections on its own (by dynamically
45+ // enumerating currently loaded modules via the dl_iterate_phdr() API and
46+ // finding their ".eh_frame" sections); Others, like Windows, require modules
47+ // to actively register their unwind info sections via unwinder API.
3848#[ cfg( all( target_os = "windows" , target_arch = "x86" , target_env = "gnu" ) ) ]
3949pub mod eh_frames {
4050 #[ no_mangle]
@@ -62,20 +72,19 @@ pub mod eh_frames {
6272 }
6373
6474 // Unwind info registration/deregistration routines.
65- // See the docs of libpanic_unwind.
6675 extern "C" {
67- fn rust_eh_register_frames ( eh_frame_begin : * const u8 , object : * mut u8 ) ;
68- fn rust_eh_unregister_frames ( eh_frame_begin : * const u8 , object : * mut u8 ) ;
76+ fn __register_frame_info ( eh_frame_begin : * const u8 , object : * mut u8 ) ;
77+ fn __deregister_frame_info ( eh_frame_begin : * const u8 , object : * mut u8 ) ;
6978 }
7079
7180 unsafe extern "C" fn init ( ) {
7281 // register unwind info on module startup
73- rust_eh_register_frames ( & __EH_FRAME_BEGIN__ as * const u8 , & mut OBJ as * mut _ as * mut u8 ) ;
82+ __register_frame_info ( & __EH_FRAME_BEGIN__ as * const u8 , & mut OBJ as * mut _ as * mut u8 ) ;
7483 }
7584
7685 unsafe extern "C" fn uninit ( ) {
7786 // unregister on shutdown
78- rust_eh_unregister_frames ( & __EH_FRAME_BEGIN__ as * const u8 , & mut OBJ as * mut _ as * mut u8 ) ;
87+ __deregister_frame_info ( & __EH_FRAME_BEGIN__ as * const u8 , & mut OBJ as * mut _ as * mut u8 ) ;
7988 }
8089
8190 // MinGW-specific init/uninit routine registration
0 commit comments