-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't initialize memory for late resources #52
Comments
There is a rustc "bug" hidden in here: There's no need to put an |
The underlying rustc bug is rust-lang/rust#41315, which was fixed by rust-lang/rust#48908, so this should work now |
triage: blocked on rust-embedded/cortex-m-rt#116 |
Is this fixed with having the |
Yes, this has already been implemented. |
Late resources are initialized at runtime so their memory doesn't need to be initialized before main / init. However, today, late resources are placed in the
.data
section so not only they get initialized (using memcpy) but they also use up FLASH memory (because everything in.data
has some initial value stored in FLASH).To fix this we'll have to create a new section, let's call it
.uninit
, in cortex-m-rt and then place thestatic
variables that will be used with late resources in that section. The change in this repo is minimal; here's the patch (macros/src/trans.rs):But this change requires updating cortex-m-rt, specially if rust-embedded/cortex-m-rt#43 lands. It's probably best to wait until rust-embedded/cortex-m-rt#43 lands.
The text was updated successfully, but these errors were encountered: