Skip to content

Commit

Permalink
Fix missing macOS slice
Browse files Browse the repository at this point in the history
This adds the `S_ATTR_NO_DEAD_STRIP` section attribute, which forces
"unused" code to remain in the binary. This is paired with `S_REGULAR`
to provide a required section type.

This fixes dtolnay#41.
  • Loading branch information
nvzqz committed Jan 9, 2022
1 parent 7e176bf commit 11cf38a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion impl/src/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub mod macos {
use syn::Ident;

pub fn section(ident: &Ident) -> String {
format!("__DATA,__linkme{}", crate::hash(ident))
format!("__DATA,__linkme{},regular,no_dead_strip", crate::hash(ident))
}

pub fn section_start(ident: &Ident) -> String {
Expand Down

0 comments on commit 11cf38a

Please sign in to comment.