文件名称:flip-link:为嵌入式程序添加零成本的堆栈溢出保护
文件大小:26KB
文件格式:ZIP
更新时间:2024-05-02 11:05:57
rust embedded tooling linkers embedded-rust
flip-link 为嵌入式程序添加零成本的堆栈溢出保护 问题 在堆栈溢出的情况下,裸机Rust程序可能不是内存安全的。 例如,基于cortex-m-rt板条箱的v0.6.x的Rust程序就是这种情况。 下面的程序,其中包含unsafe代码块,如果达到堆栈溢出条件,则可能会以不确定的方式运行。 // static variables placed in the .bss / .data sections static FLAG1: AtomicBool = AtomicU32 :: new ( false ); // .bss static FLAG2: AtomicBool = AtomicU32 :: new ( true ); // .data fn main () { let _x = fib ( 100 ); } #[inline(never)] fn fib (
【文件预览】:
flip-link-main
----LICENSE-MIT(1022B)
----LICENSE-APACHE(11KB)
----Cargo.lock(7KB)
----.github()
--------FUNDING.yml(725B)
--------workflows()
--------bors.toml(46B)
----assets()
--------flipped.svg(13KB)
--------overflow.svg(14KB)
----test-flip-link-app()
--------Cargo.toml(331B)
--------examples()
--------.gitignore(167B)
--------.cargo()
----src()
--------main.rs(11KB)
--------argument_parser.rs(1KB)
--------linking.rs(2KB)
----Cargo.toml(619B)
----.gitignore(8B)
----CHANGELOG.md(766B)
----README.md(5KB)