Skip to content

Add relBaseOffset to RelocationInfo#159

Merged
ZehMatt merged 1 commit intozyantific:masterfrom
brampedgex:rel-base-offset
Feb 22, 2026
Merged

Add relBaseOffset to RelocationInfo#159
ZehMatt merged 1 commit intozyantific:masterfrom
brampedgex:rel-base-offset

Conversation

@brampedgex
Copy link
Contributor

rel32 offsets / rip-relative displacements start from the end of the instruction, which isn't always the same as the end of the offset value in memory. This PR adds relBaseOffset to RelocationInfo, which is an offset from the location of the rel32 relocation which the relative displacement begins from (in most cases, this will be 4).

I also added test cases that demonstrate a relocation that doesn't have a relBaseOffset of 4 (a rip-relative CMP).

@ZehMatt
Copy link
Collaborator

ZehMatt commented Feb 22, 2026

Makes sense, appreciated!

@ZehMatt ZehMatt merged commit d09bc88 into zyantific:master Feb 22, 2026
6 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.

2 participants