This is an archive of the discontinued LLVM Phabricator instance.

[libunwind][OR1K] Fix register restore on resume
ClosedPublic

Authored by occheung on Jul 29 2021, 12:53 AM.

Details

Reviewers
whitequark
compnerd
Group Reviewers
Restricted Project
Commits
rGd6d0b6559e97: unwind: repair register restoration for OR1K
Summary

Currently, OR1K architecture put the program counter at offset 0x128 of the current or1k_thread_state_t. However, the PC is restored after updating the thread pointer in r3, which causes the PC to be fetched incorrectly.

This patch swaps the order of restoration of r9 and r3, such that the PC is restored to r9 using the current thread state.

Diff Detail

Event Timeline

occheung created this revision.Jul 29 2021, 12:53 AM
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 29 2021, 12:53 AM
occheung requested review of this revision.Jul 29 2021, 12:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 29 2021, 12:53 AM
compnerd accepted this revision.Jul 29 2021, 1:17 PM
This revision is now accepted and ready to land.Jul 29 2021, 1:17 PM

Thank you for the approval. I do not have commit access, please commit this patch for me.

This revision was automatically updated to reflect the committed changes.