chore(core): save 15KB of flash by eliminating source filenames
What changed, and why it matters
This commit is a routine size-optimization change for the Trezor firmware. It removes source filenames from compiled code to save 15KB of flash storage and rearranges linker sections. There is no indication this is a security fix or introduces a vulnerability.
No security action required. Treat as normal build optimization.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change adds -Z location-detail=line to Rust compiler flags, which strips source filenames from debug location information while keeping line numbers. It also swaps the placement of .text* and frozen_mpy.o(.rodata*) sections between .flash1 and .flash2 linker segments. The commit message frames this purely as a flash-size optimization with no changelog entry.
Changed components
core/embed/.cargo/config.tomlcore/embed/sys/linker/stm32f4/firmware.ldInspect captured patch +4 / −3
### core/embed/.cargo/config.toml
@@ -28,6 +28,8 @@ rustflags = [
# - https://github.com/japaric/stack-sizes/
"-Z",
"emit-stack-sizes",
+ "-Z",
+ "location-detail=line"
]
[target.thumbv8m.main-none-eabihf]
### core/embed/sys/linker/stm32f4/firmware.ld
@@ -36,16 +36,15 @@ SECTIONS {
. = ALIGN(COREAPP_ALIGNMENT);
KEEP(*(.coreapp_header));
. = ALIGN(4);
- *frozen_mpy.o(.rodata*);
+ *(.text*);
. = ALIGN(4);
KEEP(*(.bootloader));
*(.bootloader*);
. = ALIGN(4);
} >FLASH AT>FLASH
.flash2 : ALIGN(512) {
- . = ALIGN(4);
- *(.text*);
+ *frozen_mpy.o(.rodata*);
. = ALIGN(4);
*(.rodata*);
. = ALIGN(512);Why this scored 11/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.