#boot #link #macro #section

macro no-std link-boot

macros for link mod to boot section

3 unstable releases

Uses new Rust 2024

0.2.1 Mar 29, 2025
0.2.0 Mar 29, 2025
0.1.0 Mar 29, 2025

#39 in #boot

Download history 167/week @ 2025-03-23 185/week @ 2025-03-30 43/week @ 2025-04-06 11/week @ 2025-04-13 6/week @ 2025-04-20

412 downloads per month

MIT license

4KB

Link Boot

This is a macros crate to link mod to .text.boot or .data.boot section.

Example

#[link_boot::link_boot]
mod boot {
    pub fn fooo() {
        println!("foo");
    }

    pub static BAR: i32 = 1;

    struct Cat {}
}

expand to:

mod boot {
    #[unsafe(link_section = ".text.boot")]
    pub fn fooo() {
        {
            std::io::_print(std::format_args_nl!("foo"));
        };
    }
    #[unsafe(link_section = ".data.boot")]
    pub static BAR: i32 = 1;
    struct Cat {}
}

Dependencies

~205–640KB
~15K SLoC