-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
As it is don for C-apps in #552.
The linking is done rather differently for Rust:
- LLD: https://github.com/LedgerHQ/ledger-device-rust-sdk/blob/master/ledger_secure_sdk_sys/link.ld#L77
- relocation: https://github.com/LedgerHQ/ledger-device-rust-sdk/blob/master/ledger_secure_sdk_sys/link_wrap.sh
- then at app startup these calls: https://github.com/LedgerHQ/ledger-device-rust-sdk/blob/13ede06b1c28063689aa487a08ff6a00a344fd18/ledger_secure_sdk_sys/src/c/src.c#L313 (namely
link_pass_nvram()andlink_pass_ram())
We may want to look for:
_nvm_data_start- for the beginning of NVRAM zone_nvram_prev_runor_envram_data- for its end
in a separate.nvm_datasection (another segment).
There are sys_nvm_write() calls at the app-boilerplate-rust start-up at address c0df2e00 (=.rodata, _erelocs, _nvram_data - relocations are being made ?)
.nvm_data section is linked to flash2 segment, different form flash with .text. So we may pass by chance here https://github.com/LedgerHQ/speculos/blob/master/src/launcher.c#L247 aading an additional page to .text section. What if the writable NVRAM is bigger ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels