Cargo build does not emit elf binary

Hello everyone

I'm rather new to rust and I'm interested in using rust for targeting embedded systems. I'm trying to follow the embedded rust book but I'm basically stuck on the first example. In Section 2.1 Inspecting I'm supposed to be able to inspect the binary using "cargo readobj --bin app -- -file-headers". This fails, and upon inspection I found that there is no elf file and no debug symbols anywhere in the project folders.

Versions:

PS C:\Users\AnderssonAlexander\Code\app> cargo --version
cargo 1.54.0 (5ae8d74b3 2021-06-22)
PS C:\Users\AnderssonAlexander\Code\app> rustup --version
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.54.0 (a178d0322 2021-07-26)`
PS C:\Users\AnderssonAlexander\Code\app> arm-none-eabi-gdb --version
C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.07\bin\arm-none-eabi-gdb.exe: warning: Couldn't determine a path for the index cache directory.
GNU gdb (GNU Arm Embedded Toolchain 10.3-2021.07) 10.2.90.20210621-git

I don't know how to debug this because there are no error messages in the build process. If this was a make project I would say that the final linking step was missing. In rust, I'm not quite able to understand how it is supposed to work. Any help would be greatly appreciated!

Cargo build verbose output, if interesting:

PS C:\Users\AnderssonAlexander\Code\app> cargo clean
PS C:\Users\AnderssonAlexander\Code\app> cargo build --verbose
   Compiling typenum v1.13.0
   Compiling semver-parser v0.7.0
   Compiling version_check v0.9.3
   Compiling cortex-m v0.7.3
   Compiling proc-macro2 v1.0.29
   Compiling unicode-xid v0.2.2
   Compiling nb v1.0.0
   Compiling syn v1.0.75
   Compiling vcell v0.1.3
   Compiling void v1.0.2
   Compiling bitfield v0.13.2
   Compiling cortex-m-rt v0.6.15
     Running `rustc --crate-name build_script_main --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\typenum-1.13.0\build/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=29d3b701980c6b3d -C extra-filename=-29d3b701980c6b3d --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\build\typenum-29d3b701980c6b3d -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow`
     Running `rustc --crate-name semver_parser C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\semver-parser-0.7.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=af060443c78b5ec9 -C extra-filename=-af060443c78b5ec9 --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow`
     Running `rustc --crate-name version_check C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\version_check-0.9.3\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=2cd2354f4288f46e -C extra-filename=-2cd2354f4288f46e --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow`
     Running `rustc --crate-name build_script_build --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-0.7.3\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=b672c0de61ffc9b4 -C extra-filename=-b672c0de61ffc9b4 --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\build\cortex-m-b672c0de61ffc9b4 -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow`
     Running `rustc --crate-name build_script_build --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\proc-macro2-1.0.29\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"default\"" --cfg "feature=\"proc-macro\"" -C metadata=77a5d2a2c4242a10 -C extra-filename=-77a5d2a2c4242a10 --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\build\proc-macro2-77a5d2a2c4242a10 -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow`
     Running `rustc --crate-name unicode_xid C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\unicode-xid-0.2.2\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"default\"" -C metadata=5fa927026751bce4 -C extra-filename=-5fa927026751bce4 --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow`
     Running `rustc --crate-name nb --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\nb-1.0.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=07e47a8eebb0588b -C extra-filename=-07e47a8eebb0588b --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
     Running `rustc --crate-name build_script_build --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\syn-1.0.75\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"clone-impls\"" --cfg "feature=\"default\"" --cfg "feature=\"derive\"" --cfg "feature=\"extra-traits\"" --cfg "feature=\"full\"" --cfg "feature=\"parsing\"" --cfg "feature=\"printing\"" --cfg "feature=\"proc-macro\"" --cfg "feature=\"quote\"" -C metadata=b78faa89ab387886 -C extra-filename=-b78faa89ab387886 --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\build\syn-b78faa89ab387886 -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow`
     Running `rustc --crate-name vcell C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\vcell-0.1.3\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=d039b39e378b60a9 -C extra-filename=-d039b39e378b60a9 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
     Running `rustc --crate-name void C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\void-1.0.2\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=40f8e950d81c501a -C extra-filename=-40f8e950d81c501a --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
     Running `rustc --crate-name bitfield C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\bitfield-0.13.2\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=3019a311c8126d0a -C extra-filename=-3019a311c8126d0a --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
     Running `rustc --crate-name build_script_build C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-rt-0.6.15\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=de2485d3e35141f3 -C extra-filename=-de2485d3e35141f3 --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\build\cortex-m-rt-de2485d3e35141f3 -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow`
   Compiling stable_deref_trait v1.2.0
     Running `rustc --crate-name stable_deref_trait C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\stable_deref_trait-1.2.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=d27e1e7f7df0ce69 -C extra-filename=-d27e1e7f7df0ce69 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
   Compiling cortex-m v0.6.7
     Running `rustc --crate-name build_script_build --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-0.6.7\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=58e031fbdfa53ed6 -C extra-filename=-58e031fbdfa53ed6 --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\build\cortex-m-58e031fbdfa53ed6 -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow`
   Compiling cortex-m-semihosting v0.3.7
     Running `rustc --crate-name build_script_build --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-semihosting-0.3.7\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=470c7796eb6e25d5 -C extra-filename=-470c7796eb6e25d5 --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\build\cortex-m-semihosting-470c7796eb6e25d5 -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow`
   Compiling r0 v0.2.2
     Running `rustc --crate-name r0 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\r0-0.2.2\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=6e4cd623ecfac51c -C extra-filename=-6e4cd623ecfac51c --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
   Compiling app v0.1.0 (C:\Users\AnderssonAlexander\Code\app)
   Compiling panic-halt v0.2.0
     Running `rustc --crate-name build_script_build --edition=2018 build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=0f6042d85180b18e -C extra-filename=-0f6042d85180b18e --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\build\app-0f6042d85180b18e -C incremental=C:\Users\AnderssonAlexander\Code\app\target\debug\incremental -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps`
     Running `rustc --crate-name panic_halt C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\panic-halt-0.2.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=852ccb1bb0077530 -C extra-filename=-852ccb1bb0077530 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
   Compiling volatile-register v0.2.1
     Running `rustc --crate-name volatile_register C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\volatile-register-0.2.1\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=c3980db79e68c758 -C extra-filename=-c3980db79e68c758 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern vcell=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libvcell-d039b39e378b60a9.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
   Compiling nb v0.1.3
     Running `rustc --crate-name nb C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\nb-0.1.3\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=e6063f8d97fb5fe5 -C extra-filename=-e6063f8d97fb5fe5 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern nb=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libnb-07e47a8eebb0588b.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
   Compiling semver v0.9.0
     Running `rustc --crate-name semver C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\semver-0.9.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"default\"" -C metadata=c584996c7b1f265f -C extra-filename=-c584996c7b1f265f --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern semver_parser=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libsemver_parser-af060443c78b5ec9.rmeta --cap-lints allow`
   Compiling embedded-hal v0.2.6
     Running `rustc --crate-name embedded_hal C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\embedded-hal-0.2.6\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=c5bb3ba5980ae7d9 -C extra-filename=-c5bb3ba5980ae7d9 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern nb=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libnb-e6063f8d97fb5fe5.rmeta --extern void=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libvoid-40f8e950d81c501a.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
     Running `C:\Users\AnderssonAlexander\Code\app\target\debug\build\proc-macro2-77a5d2a2c4242a10\build-script-build`
     Running `C:\Users\AnderssonAlexander\Code\app\target\debug\build\cortex-m-b672c0de61ffc9b4\build-script-build`
     Running `C:\Users\AnderssonAlexander\Code\app\target\debug\build\cortex-m-rt-de2485d3e35141f3\build-script-build`
     Running `C:\Users\AnderssonAlexander\Code\app\target\debug\build\cortex-m-58e031fbdfa53ed6\build-script-build`
     Running `C:\Users\AnderssonAlexander\Code\app\target\debug\build\cortex-m-semihosting-470c7796eb6e25d5\build-script-build`
     Running `C:\Users\AnderssonAlexander\Code\app\target\debug\build\syn-b78faa89ab387886\build-script-build`
   Compiling rustc_version v0.2.3
   Compiling generic-array v0.14.4
     Running `rustc --crate-name rustc_version C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\rustc_version-0.2.3\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=d386f90152fed9cf -C extra-filename=-d386f90152fed9cf --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern semver=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libsemver-c584996c7b1f265f.rmeta --cap-lints allow`
     Running `rustc --crate-name build_script_build C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\generic-array-0.14.4\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=b8c9ab18f69cee0d -C extra-filename=-b8c9ab18f69cee0d --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\build\generic-array-b8c9ab18f69cee0d -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern version_check=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libversion_check-2cd2354f4288f46e.rlib --cap-lints allow`
     Running `rustc --crate-name proc_macro2 --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\proc-macro2-1.0.29\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"default\"" --cfg "feature=\"proc-macro\"" -C metadata=9ffba8ccc1d5ed1b -C extra-filename=-9ffba8ccc1d5ed1b --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern unicode_xid=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libunicode_xid-5fa927026751bce4.rmeta --cap-lints allow --cfg lexerror_display --cfg hygiene --cfg literal_from_str --cfg use_proc_macro --cfg wrap_proc_macro`
     Running `C:\Users\AnderssonAlexander\Code\app\target\debug\build\typenum-29d3b701980c6b3d\build-script-main`
     Running `C:\Users\AnderssonAlexander\Code\app\target\debug\build\app-0f6042d85180b18e\build-script-build`
     Running `rustc --crate-name typenum --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\typenum-1.13.0\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=563b3cceae945f5d -C extra-filename=-563b3cceae945f5d --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
     Running `C:\Users\AnderssonAlexander\Code\app\target\debug\build\generic-array-b8c9ab18f69cee0d\build-script-build`
   Compiling bare-metal v0.2.5
     Running `rustc --crate-name build_script_build C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\bare-metal-0.2.5\build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"const-fn\"" -C metadata=a01c22be69d6d9db -C extra-filename=-a01c22be69d6d9db --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\build\bare-metal-a01c22be69d6d9db -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern rustc_version=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\librustc_version-d386f90152fed9cf.rlib --cap-lints allow`
     Running `C:\Users\AnderssonAlexander\Code\app\target\debug\build\bare-metal-a01c22be69d6d9db\build-script-build`
   Compiling quote v1.0.9
     Running `rustc --crate-name quote --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\quote-1.0.9\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"default\"" --cfg "feature=\"proc-macro\"" -C metadata=3bce4bbcead9e170 -C extra-filename=-3bce4bbcead9e170 --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern proc_macro2=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libproc_macro2-9ffba8ccc1d5ed1b.rmeta --cap-lints allow`
     Running `rustc --crate-name bare_metal C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\bare-metal-0.2.5\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"const-fn\"" -C metadata=c1888870de551dcc -C extra-filename=-c1888870de551dcc --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
     Running `rustc --crate-name syn --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\syn-1.0.75\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"clone-impls\"" --cfg "feature=\"default\"" --cfg "feature=\"derive\"" --cfg "feature=\"extra-traits\"" --cfg "feature=\"full\"" --cfg "feature=\"parsing\"" --cfg "feature=\"printing\"" --cfg "feature=\"proc-macro\"" --cfg "feature=\"quote\"" -C metadata=d2e1a7b5790f6717 -C extra-filename=-d2e1a7b5790f6717 --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern proc_macro2=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libproc_macro2-9ffba8ccc1d5ed1b.rmeta --extern quote=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libquote-3bce4bbcead9e170.rmeta --extern unicode_xid=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libunicode_xid-5fa927026751bce4.rmeta --cap-lints allow --cfg syn_disable_nightly_tests`
     Running `rustc --crate-name cortex_m --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-0.7.3\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=c413479a7387981b -C extra-filename=-c413479a7387981b --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern bare_metal=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libbare_metal-c1888870de551dcc.rmeta --extern bitfield=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libbitfield-3019a311c8126d0a.rmeta --extern embedded_hal=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libembedded_hal-c5bb3ba5980ae7d9.rmeta --extern volatile_register=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libvolatile_register-c3980db79e68c758.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x -L C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\build\cortex-m-ca50208f185562b1\out --cfg cortex_m --cfg armv7m -l static=cortex-m`
     Running `rustc --crate-name cortex_m_semihosting --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-semihosting-0.3.7\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=823eaa228d12dbd3 -C extra-filename=-823eaa228d12dbd3 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern cortex_m=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libcortex_m-c413479a7387981b.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x -L C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\build\cortex-m-semihosting-65751c6a0abbbcf6\out --cfg thumb -l static=cortex-m-semihosting -L C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\build\cortex-m-ca50208f185562b1\out`
   Compiling generic-array v0.12.4
   Compiling generic-array v0.13.3
     Running `rustc --crate-name generic_array C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\generic-array-0.12.4\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=abf1a2e8319fb2c0 -C extra-filename=-abf1a2e8319fb2c0 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern typenum=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libtypenum-563b3cceae945f5d.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
     Running `rustc --crate-name generic_array C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\generic-array-0.14.4\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=661da2f325c6aba2 -C extra-filename=-661da2f325c6aba2 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern typenum=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libtypenum-563b3cceae945f5d.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x --cfg relaxed_coherence`
     Running `rustc --crate-name generic_array C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\generic-array-0.13.3\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=d766d007a4d84b42 -C extra-filename=-d766d007a4d84b42 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern typenum=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libtypenum-563b3cceae945f5d.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
   Compiling as-slice v0.1.5
     Running `rustc --crate-name as_slice C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\as-slice-0.1.5\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=9cba25d98d917969 -C extra-filename=-9cba25d98d917969 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern generic_array=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libgeneric_array-abf1a2e8319fb2c0.rmeta --extern ga13=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libgeneric_array-d766d007a4d84b42.rmeta --extern ga14=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libgeneric_array-661da2f325c6aba2.rmeta --extern stable_deref_trait=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libstable_deref_trait-d27e1e7f7df0ce69.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`
   Compiling aligned v0.3.5
     Running `rustc --crate-name aligned --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\aligned-0.3.5\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=dde0453f11493f03 -C extra-filename=-dde0453f11493f03 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern as_slice=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libas_slice-9cba25d98d917969.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x`

Continued:

     Running `rustc --crate-name cortex_m --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-0.6.7\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=011afc35f0c41d6a -C extra-filename=-011afc35f0c41d6a --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern aligned=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libaligned-dde0453f11493f03.rmeta --extern bare_metal=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libbare_metal-c1888870de551dcc.rmeta --extern bitfield=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libbitfield-3019a311c8126d0a.rmeta --extern cortex_m_0_7=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libcortex_m-c413479a7387981b.rmeta --extern volatile_register=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libvolatile_register-c3980db79e68c758.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x --cfg cortex_m --cfg armv7m -L C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\build\cortex-m-ca50208f185562b1\out`
   Compiling cortex-m-rt-macros v0.6.15
     Running `rustc --crate-name cortex_m_rt_macros --edition=2018 C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-rt-macros-0.6.15\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C embed-bitcode=no -C debuginfo=2 -C metadata=66f2b1187099188b -C extra-filename=-66f2b1187099188b --out-dir C:\Users\AnderssonAlexander\Code\app\target\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern proc_macro2=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libproc_macro2-9ffba8ccc1d5ed1b.rlib --extern quote=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libquote-3bce4bbcead9e170.rlib --extern syn=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\libsyn-d2e1a7b5790f6717.rlib --extern proc_macro --cap-lints allow`
     Running `rustc --crate-name cortex_m_rt C:\Users\AnderssonAlexander\.cargo\registry\src\github.com-1ecc6299db9ec823\cortex-m-rt-0.6.15\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=8191030c471bb961 -C extra-filename=-8191030c471bb961 --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern cortex_m_rt_macros=C:\Users\AnderssonAlexander\Code\app\target\debug\deps\cortex_m_rt_macros-66f2b1187099188b.dll --extern r0=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libr0-6e4cd623ecfac51c.rmeta --cap-lints allow -C link-arg=--nmagic -C link-arg=-Tlink.x -L C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\build\cortex-m-rt-01279e9d84b53ccf\out --cfg cortex_m --cfg armv7m -l static=cortex-m-rt`
     Running `rustc --crate-name app --edition=2018 src\main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=b61d09da327b6eec -C extra-filename=-b61d09da327b6eec --out-dir C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps --target thumbv7m-none-eabi -C incremental=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\incremental -L dependency=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps -L dependency=C:\Users\AnderssonAlexander\Code\app\target\debug\deps --extern cortex_m=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libcortex_m-011afc35f0c41d6a.rlib --extern cortex_m_rt=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libcortex_m_rt-8191030c471bb961.rlib --extern cortex_m_semihosting=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libcortex_m_semihosting-823eaa228d12dbd3.rlib --extern panic_halt=C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\deps\libpanic_halt-852ccb1bb0077530.rlib -C link-arg=--nmagic -C link-arg=-Tlink.x -L C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\build\app-b6e0cabf52ba9d7d\out -L C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\build\cortex-m-ca50208f185562b1\out -L C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\build\cortex-m-rt-01279e9d84b53ccf\out -L C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug\build\cortex-m-semihosting-65751c6a0abbbcf6\out`
    Finished dev [unoptimized + debuginfo] target(s) in 10.43s
PS C:\Users\AnderssonAlexander\Code\app> cargo readobj --bin app -- -file-headers
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Failed to execute tool: readobj
The system cannot find the file specified. (os error 2)

Build artefacts aren't placed right in the project root; that would clutter the directory structure considerably. They are under target/debug, target/release, etc.

Hello. Thanks for you reply.

I am aware of that. What I meant is that the build artefacts don't exist anywhere in the project folder, not even in the target/debug folder subtree.

Edit: That is not completely true. The object files are created, but not the final binary. This is why I thought the problem might be linker related.

So there is no app-<long hex string> file transitively under C:\Users\AnderssonAlexander\Code\app\target\thumbv7m-none-eabi\debug?

Ok, so I've done a lot more digging now and for now it works and I'm not sure why. A few things have happened:

  • It seems that the elf binary was emitted all this time, but I just didn't quite know what to look for. I'm used to a Windows environment where we use helpful file-endings.
  • The readobj-tool didn't work before. It seems like there must have been some installation issue:
    PS C:\Users\AnderssonAlexander\Code\app> cargo readobj --bin app -- -file-headers Finished dev [unoptimized + debuginfo] target(s) in 0.04s Failed to execute tool: readobj The system cannot find the file specified. (os error 2)
    I'm not sure what I did to solve it, but now that part works.

For now I will keep working through the book. Thanks!

One detail:

Unix-y tools and systems also make use of extensions, except for executable programs. The long hex string at the end of the file name is a hash, added by the build process so that it can confidently decide which exact build of dependencies to use, what to recompile and when, etc. instead of having to rely on less robust methods like time stamps.

Noted. Thanks for the information! :slight_smile:

This means that the readobj executable isn't installed. Run rustup component add llvm-tools-preview to fix this.

1 Like