Skip to content

Instantly share code, notes, and snippets.

View skoe's full-sized avatar

Thomas Giesel skoe

View GitHub Profile
@skoe
skoe / ld.x
Last active September 12, 2022 18:32
Pure Rust Start-Up Code - Attempt 2
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
@skoe
skoe / startup.rs
Created November 20, 2020 23:01
Pure Rust Start-Up Code w/o Pointer Provenance issues?
#[no_mangle]
pub unsafe extern "C" fn ResetHandler() -> ! {
run();
loop {}
}
pub unsafe fn run() {
extern "C" {
static mut _sbss: u32;
static mut _ebss: u32;