Skip to content

i#3544 RV64: Implement relink_special_ibl_xfer() #7437

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

Merged
merged 6 commits into from
May 24, 2025

Conversation

ziyao233
Copy link
Member

@ziyao233 ziyao233 commented Apr 5, 2025

Similar to AArch64, we cannot jump to an address storing in memory directly on RISC-V, thus an instruction sequence of loading to scratch (ld) and branching to register (jalr) must be used in special IBL. It's only required to adjust the offset used in loading insturction during relinking.

As drwrap-related tests aren't enabled on RV64, this commit is tested by manually inspecting the relinked IBL in debugger and applications that make use of shared libraries, for example, ld.bfd with LTO plugin, where the address range is flushed on library unloading. Unit tests could be introduced later.

Issue: #3544

Similar to AArch64, we cannot jump to an address storing in memory
directly on RISC-V, thus an instruction sequence of loading to scratch
(ld) and branching to register (jalr) must be used in special IBL. It's
only required to adjust the offset used in loading insturction during
relinking.

This commit is tested by manually inspecting the relinked IBL in
debugger and applications that make use of shared libraries, for
example, ld.bfd with LTO plugin, where the address range is flushed on
library unloading.

Issue: DynamoRIO#3544
@ziyao233 ziyao233 requested a review from ksco April 5, 2025 13:01
@ksco ksco requested a review from derekbruening April 7, 2025 09:05
@ziyao233
Copy link
Member Author

I'm too busy this month and plan to continue working on the PR in May. Thanks for your patience :)

@ziyao233 ziyao233 requested a review from derekbruening May 23, 2025 08:49
@ziyao233 ziyao233 merged commit 0502fd3 into DynamoRIO:master May 24, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants