Skip to content

Commit

Permalink
Use verbose keywords in linker fragments
Browse files Browse the repository at this point in the history
When using flip-link for stack overflow protection, it parses the linker
scripts/fragments for RAM memory addresses and expects the keywords
'ORIGIN' and 'LENGTH' to be used in its verbose form. Allow
friction-less integration of flip-link and this crate by using the
verbose form.
  • Loading branch information
sirhcel authored and Sh3Rm4n committed Jun 14, 2021
1 parent 235f117 commit 95b17fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ This may be due to incorrect feature configuration in Cargo.toml or stm32f3xx-ha
let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
let mut file = File::create(out_dir.join("memory.x")).unwrap();
writeln!(file, "MEMORY {{").unwrap();
writeln!(file, " FLASH (rx) : o = 0x8000000, l = {}K", flash).unwrap();
writeln!(file, " FLASH (rx) : ORIGIN = 0x8000000, LENGTH = {}K", flash).unwrap();
if ccmram > 0 {
writeln!(file, " CCMRAM (rwx) : o = 0x10000000, l = {}K", ccmram).unwrap();
writeln!(file, " CCMRAM (rwx) : ORIGIN = 0x10000000, LENGTH = {}K", ccmram).unwrap();
}
writeln!(file, " RAM (rwx) : o = 0x20000000, l = {}K", ram).unwrap();
writeln!(file, " RAM (rwx) : ORIGIN = 0x20000000, LENGTH = {}K", ram).unwrap();
writeln!(file, "}}").unwrap();
println!("cargo:rustc-link-search={}", out_dir.display());
}

0 comments on commit 95b17fc

Please sign in to comment.