| Crates.io | embedded-test-linker-script |
| lib.rs | embedded-test-linker-script |
| version | 0.1.0-alpha.2 |
| created_at | 2025-08-07 09:33:51.102445+00 |
| updated_at | 2025-08-20 09:01:42.424609+00 |
| description | Linker script for embedded-test |
| homepage | |
| repository | https://github.com/probe-rs/embedded-test |
| max_upload_size | |
| id | 1784971 |
| size | 4,726 |
Linker Script for the embedded-test crate.
Allows you to write
[dependencies]
embedded-test-linker-script = { version = "0.1.0" }
[dev-dependencies]
embedded-test = { version = "0.7.0" }
instead of
[dependencies]
embedded-test = { version = "0.7.0" }
embedded-test stores the testcases in a custom section of the ELF file and probe-rs reads that section to run the tests. This section needs to be kept by the linker, so we need a custom linker script.
Cargo provides cargo:rustc-link-arg-tests to add a linker script for all integration tests. But there is no
corresponding instruction to add a linker script for bin/lib unit-tests (see
issue rust-lang/10937).
As a consequence we have to use cargo:rustc-link-arg which adds the linker script unconditionally, but requires us
to host at least the linker script in a crate added to [dependencies] instead of [dev-dependencies].