1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[no_mangle]
#[naked]
pub unsafe extern "C" fn _start() {
    // Align the stack and jump to rust code. If we come back, trigger an exception.
    core::arch::asm!(
        "and rsp, 0xfffffffffffffff0",
        "call {entry}",
        "ud2",
        entry = sym crate::rt0::entry,
        options(noreturn)
    );
}

#[used]
// Ensure the compiler doesn't optimize us away!
static ENTRY: unsafe extern "C" fn() = _start;