Skip to content

Commit 95b17fc

Browse files
sirhcelSh3Rm4n
authored andcommitted
Use verbose keywords in linker fragments
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.
1 parent 235f117 commit 95b17fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ This may be due to incorrect feature configuration in Cargo.toml or stm32f3xx-ha
169169
let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
170170
let mut file = File::create(out_dir.join("memory.x")).unwrap();
171171
writeln!(file, "MEMORY {{").unwrap();
172-
writeln!(file, " FLASH (rx) : o = 0x8000000, l = {}K", flash).unwrap();
172+
writeln!(file, " FLASH (rx) : ORIGIN = 0x8000000, LENGTH = {}K", flash).unwrap();
173173
if ccmram > 0 {
174-
writeln!(file, " CCMRAM (rwx) : o = 0x10000000, l = {}K", ccmram).unwrap();
174+
writeln!(file, " CCMRAM (rwx) : ORIGIN = 0x10000000, LENGTH = {}K", ccmram).unwrap();
175175
}
176-
writeln!(file, " RAM (rwx) : o = 0x20000000, l = {}K", ram).unwrap();
176+
writeln!(file, " RAM (rwx) : ORIGIN = 0x20000000, LENGTH = {}K", ram).unwrap();
177177
writeln!(file, "}}").unwrap();
178178
println!("cargo:rustc-link-search={}", out_dir.display());
179179
}

0 commit comments

Comments
 (0)