We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a731f87 commit 8446a19Copy full SHA for 8446a19
1 file changed
src/abi.md
@@ -96,10 +96,10 @@ The *`link_section` attribute* specifies the section of the object file that a
96
r[abi.link_section.syntax]
97
The `link_section` attribute uses the [MetaNameValueStr] syntax to specify the section name.
98
99
-<!-- no_run: don't link. The format of the section name is platform-specific. -->
100
-```rust,no_run
+```rust
101
#[unsafe(no_mangle)]
102
-#[unsafe(link_section = ".example_section")]
+#[cfg_attr(target_os = "linux", unsafe(link_section = ".example_section"))]
+#[cfg_attr(target_os = "macos", unsafe(link_section = "__DATA,example_section"))]
103
pub static VAR1: u32 = 1;
104
```
105
0 commit comments