-
Notifications
You must be signed in to change notification settings - Fork 144
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
cortex-m-rt: Remove LR push, to ensure the stack is 8-byte aligned. #467
Conversation
9488c5f
to
17b1a3e
Compare
This was causing incorrect execution of code optimized with the assumption the stack is 8-byte aligned.
17b1a3e
to
ebf2dd6
Compare
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.
Love it,
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.
On balance I want to go this route, instead of #463. Thanks for preparing all the PRs @Dirbaio, and thanks to everyone else who helped investigate, especially @Dirbaio and @jamesmunns, and @peter9477 for spotting the issue in the first place.
There's a lot of useful context, explanation, and research in the #463 thread, though, so future readers should check it out.
Apologies in advance to the probe-run team; I think in the end it's best to go directly to the solution we want to stick with, and hopefully it's not too bad to patch up probe-run to eliminate the warning it will start emitting.
bors r+
Build succeeded: |
This was causing incorrect execution of code optimized with the assumption the stack is 8-byte aligned.
Alternate version of #463
bl main
anyway.Remove the .cfi directives, since Reset now has no correct CFI info. I think this is the "correct" thing to do here.Initialize the frame pointer in R7 (suggestion from @jamesmunns)