link-args can go to rustc via rustc -C link-args="-Wl,-Map=blink_stm32f4.map" test.rs
And there is a cargo rustflags option in the build section. See load configuration . It works as follows:
$ cargo new --bin testbin $ cd testbin $ cat .cargo/config [build] rustflags = ["-Clink-args=-Wl,-Map=/tmp/blink_f7.map"] $ cargo build
There is also a linker option in the cargo configuration. I am not trying to get through this gcc plus flags option, only gcc , but you can write a gcc wrapper script as:
$ cat my-linker.sh #!/bin/sh arm-...-gcc -Wl,-Map=blink_stm32f4.map $@
source share