diff --git a/crates/objc2/src/macros/mod.rs b/crates/objc2/src/macros/mod.rs index ab2ffb0a8..494c21e59 100644 --- a/crates/objc2/src/macros/mod.rs +++ b/crates/objc2/src/macros/mod.rs @@ -356,7 +356,7 @@ macro_rules! __statics_image_info { /// but things still seems to work. #[cfg_attr( not(all(target_os = "macos", target_arch = "x86")), - link_section = "__DATA,__objc_imageinfo,regular,no_dead_strip" + link_section = "__DATA,__objc_imageinfo,regular" )] #[cfg_attr( all(target_os = "macos", target_arch = "x86"), @@ -382,7 +382,7 @@ macro_rules! __statics_module_info { /// /// This is similar to image info, and must be present in the final /// binary on macOS 32-bit. - #[link_section = "__OBJC,__module_info,regular,no_dead_strip"] + #[link_section = "__OBJC,__module_info,regular"] #[export_name = $crate::__macro_helpers::concat!("\x01L_OBJC_MODULES_", $hash)] #[used] // Make sure this reaches the linker static _MODULE_INFO: $crate::__macro_helpers::ModuleInfo = @@ -439,14 +439,11 @@ macro_rules! __statics_sel { /// info on "life before main". #[cfg_attr( not(all(target_os = "macos", target_arch = "x86")), - // Clang uses `no_dead_strip` in the link section for some reason, - // which other tools (notably some LLVM tools) now assume is - // present, so we have to add it as well. - link_section = "__DATA,__objc_selrefs,literal_pointers,no_dead_strip", + link_section = "__DATA,__objc_selrefs,literal_pointers", )] #[cfg_attr( all(target_os = "macos", target_arch = "x86"), - link_section = "__OBJC,__message_refs,literal_pointers,no_dead_strip", + link_section = "__OBJC,__message_refs,literal_pointers", )] #[export_name = $crate::__macro_helpers::concat!("\x01L_OBJC_SELECTOR_REFERENCES_", $hash)] static REF: $crate::__macro_helpers::SyncUnsafeCell<$crate::runtime::Sel> = unsafe { @@ -504,7 +501,7 @@ macro_rules! __statics_class { } /// SAFETY: Same as `REF` above in `__statics_sel!`. - #[link_section = "__DATA,__objc_classrefs,regular,no_dead_strip"] + #[link_section = "__DATA,__objc_classrefs,regular"] #[export_name = $crate::__macro_helpers::concat!( "\x01L_OBJC_CLASSLIST_REFERENCES_$_", $hash, @@ -536,7 +533,7 @@ macro_rules! __statics_class { static NAME_DATA: [$crate::__macro_helpers::u8; X.len()] = $crate::__statics_string_to_known_length_bytes!(X); /// SAFETY: Same as `REF` above in `__statics_sel!`. - #[link_section = "__OBJC,__cls_refs,literal_pointers,no_dead_strip"] + #[link_section = "__OBJC,__cls_refs,literal_pointers"] #[export_name = $crate::__macro_helpers::concat!( "\x01L_OBJC_CLASS_REFERENCES_", $hash,