This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this to the linker script: | |
.text : | |
{ | |
. = ALIGN(4); | |
/* Let the linker do the pointer arithmetic. The following values must | |
* have the same layout as struct MemInfo in the Rust init | |
* implementation. It must only contain FFI-safe types. For `LONG` refer | |
* to the GNU ld manual which is referenced by the LLVM lld manual: | |
* https://sourceware.org/binutils/docs/ld/Output-Section-Data.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[no_mangle] | |
pub unsafe extern "C" fn ResetHandler() -> ! { | |
run(); | |
loop {} | |
} | |
pub unsafe fn run() { | |
extern "C" { | |
static mut _sbss: u32; | |
static mut _ebss: u32; |