about summary refs log tree commit diff
path: root/library/rtstartup
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-02-07 18:00:20 +0000
committerMichael Goulet <michael@errs.io>2025-02-09 17:10:50 +0000
commit9c486a74dac6f11276df4bbd2abc526a82cd000f (patch)
treeb5c3138554369955362136bd7b885779e5812388 /library/rtstartup
parenta26e97be8826d408309fffbd8168362365719f50 (diff)
downloadrust-9c486a74dac6f11276df4bbd2abc526a82cd000f.tar.gz
rust-9c486a74dac6f11276df4bbd2abc526a82cd000f.zip
Mark link_section attr with unsafe
Diffstat (limited to 'library/rtstartup')
-rw-r--r--library/rtstartup/rsbegin.rs6
-rw-r--r--library/rtstartup/rsend.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/library/rtstartup/rsbegin.rs b/library/rtstartup/rsbegin.rs
index d3ff5c14aa4..83ec21ade40 100644
--- a/library/rtstartup/rsbegin.rs
+++ b/library/rtstartup/rsbegin.rs
@@ -52,7 +52,7 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
 #[cfg(all(target_os = "windows", target_arch = "x86", target_env = "gnu"))]
 pub mod eh_frames {
     #[no_mangle]
-    #[link_section = ".eh_frame"]
+    #[unsafe(link_section = ".eh_frame")]
     // Marks beginning of the stack frame unwind info section
     pub static __EH_FRAME_BEGIN__: [u8; 0] = [];
 
@@ -101,10 +101,10 @@ pub mod eh_frames {
         // end of the list. Since constructors are run in reverse order, this ensures that our
         // callbacks are the first and last ones executed.
 
-        #[link_section = ".ctors.65535"] // .ctors.* : C initialization callbacks
+        #[unsafe(link_section = ".ctors.65535")] // .ctors.* : C initialization callbacks
         pub static P_INIT: unsafe extern "C" fn() = super::init;
 
-        #[link_section = ".dtors.65535"] // .dtors.* : C termination callbacks
+        #[unsafe(link_section = ".dtors.65535")] // .dtors.* : C termination callbacks
         pub static P_UNINIT: unsafe extern "C" fn() = super::uninit;
     }
 }
diff --git a/library/rtstartup/rsend.rs b/library/rtstartup/rsend.rs
index 81acfbed447..a6f7d103356 100644
--- a/library/rtstartup/rsend.rs
+++ b/library/rtstartup/rsend.rs
@@ -32,6 +32,6 @@ pub mod eh_frames {
     // Terminate the frame unwind info section with a 0 as a sentinel;
     // this would be the 'length' field in a real FDE.
     #[no_mangle]
-    #[link_section = ".eh_frame"]
+    #[unsafe(link_section = ".eh_frame")]
     pub static __EH_FRAME_END__: u32 = 0;
 }