link-section 0.19.3

Link-time initialized slices for Rust, with full support for Linux, macOS, Windows, WASM and many more platforms.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use link_section::declarative::{in_section, section};
use link_section::TypedReferenceSection;

section! {
    #[section(unsafe, type = reference)]
    static FOO: TypedReferenceSection<u32>;
}

in_section! {
    #[in_section(unsafe, type = reference, name = FOO)]
    const ITEM: u32 = 42;
}

fn main() {}