Skip to content

Commit

Permalink
Remove no_dead_strip marks
Browse files Browse the repository at this point in the history
  • Loading branch information
Berrysoft committed Nov 15, 2024
1 parent 4ea22f2 commit fa817af
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions crates/objc2/src/macros/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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 =
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit fa817af

Please sign in to comment.