Skip to content
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

i#3544: RV64: Mangle pc-relative addressing destining to tp #7068

Merged
merged 7 commits into from
Nov 11, 2024

Conversation

ziyao233
Copy link
Contributor

@ziyao233 ziyao233 commented Nov 6, 2024

Reuse mangle_stolen_reg_and_tp_reg() to simplify register spilling.

This handles code sequence like

_start:
        lla             tp,             slot
	lw              a0,             0(tp)
	li              a7,             93
	ecall
slot:   .long           0x5a

Issue: #3544

PC-relative addressing is done through auipc on RISC-V, which comes with
only one register operand, so it's always safe to use a0 here.

This handles code sequence like

```
_start:
        lla             tp,             slot
	lw              a0,             0(tp)
	li              a7,             93
	ecall
slot:   .long           0x5a
```

Issue: DynamoRIO#3544
@ksco ksco self-requested a review November 6, 2024 16:27
core/arch/riscv64/mangle.c Outdated Show resolved Hide resolved
@ksco ksco requested a review from derekbruening November 6, 2024 16:43
@ziyao233 ziyao233 requested a review from ksco November 7, 2024 02:14
core/arch/riscv64/mangle.c Outdated Show resolved Hide resolved
core/arch/riscv64/mangle.c Outdated Show resolved Hide resolved
core/arch/riscv64/mangle.c Outdated Show resolved Hide resolved
core/arch/riscv64/mangle.c Outdated Show resolved Hide resolved
core/arch/riscv64/mangle.c Outdated Show resolved Hide resolved
@ziyao233
Copy link
Contributor Author

I think this PR is ready for merging :)

@ksco ksco merged commit 72cf877 into DynamoRIO:master Nov 11, 2024
17 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