diff --git a/user-apps/doom/build.rs b/user-apps/doom/build.rs index 1dfa714..9f67aed 100644 --- a/user-apps/doom/build.rs +++ b/user-apps/doom/build.rs @@ -23,7 +23,7 @@ fn main() { let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); File::create(out.join("memory.x")) .unwrap() - .write_all(include_bytes!("../memory.x")) + .write_all(include_bytes!("memory.x")) .unwrap(); println!("cargo:rustc-link-search={}", out.display()); diff --git a/user-apps/doom/memory.x b/user-apps/doom/memory.x new file mode 100644 index 0000000..02c35b4 --- /dev/null +++ b/user-apps/doom/memory.x @@ -0,0 +1,31 @@ +MEMORY +{ + RAM : ORIGIN = 0x0, LENGTH = 400K +} + +SECTIONS +{ + .text : ALIGN(4) + { + *(.text .text.*); + *(.rodata .rodata.*); + } > RAM + + .data : ALIGN(4) + { + *(.data .data.*); + } > RAM + + .bss : ALIGN(4) + { + *(.bss .bss.*); + *(COMMON); + } > RAM + + .syscall_table (NOLOAD) : ALIGN(4) + { + __user_reloc_start = .; + KEEP(*(.user_reloc*)); + __user_reloc_end = .; + } > RAM +}