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

x86_64 imm-call relinking needs it's own private PLT/GOT to handle calls to further than 2GB away in either direction #23

Open
elfmaster opened this issue Mar 7, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@elfmaster
Copy link
Contributor

The patch image is loaded further than 2gb away in memory and thus we cannot re-link call instructions with an offset that fits in 4 bytes

@elfmaster elfmaster self-assigned this Mar 7, 2024
@elfmaster elfmaster added the bug Something isn't working label Mar 7, 2024
@elfmaster
Copy link
Contributor Author

This same problem applies to relinking load/stores of global variables with mov instructions who's destination register is only 32bits.

8b 2d f0 ad 00 00: mov 0xadf0(%rip), %ebp

The instruction above only has 3 bytes for encoding the offset, and we need 4 bytes to reach the patch target (The global variable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant