-
Notifications
You must be signed in to change notification settings - Fork 84
Fix possible overflow of .data region in FLASH #286
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jonas-schievink (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Could you maybe provide an example where this happens? I'd expect the linker to catch an issue like that, even without these changes. |
Hi, The problem only happens when the flash size is smaller than the ram size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Build succeeded: |
It looks like this PR basically half-reverts d5f2a94 since we used to use Maybe @therealprof will recall why that was necessary, and perhaps we should check we haven't re-introduced those bugs. |
I guess the thinking was that the |
Since that PR has fixed linkage errors, but linking still works, I guess it didn't reintroduce those problems |
Hi,
i found a bug on the size checking of the FLASH region, that in some cases allows it to be larger than it's defined size.
This happens because the .data section is placed on a FLASH address (at the end of __erodata) but it's not checked against the FLASH region size.
Changing the section as shown solves the issue.