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

macaw-ppc: Don't assume absolute IP addresses when decoding #350

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

RyanGlScott
Copy link
Contributor

macaw-ppc was previously assuming that addresses are absolute, which is not true for position independent executables. Extracting the offset from the address is sufficient for our purposes here (note that taking the offset from the MemSegmentOffset would not be right, as that offset is relative to the segment start).

This is the exact same issue that was noticed in 37d8029 (in macaw-aarch32), but that commit forgot to fix things on the macaw-ppc end.

`macaw-ppc` was previously assuming that addresses are absolute, which is not
true for position independent executables. Extracting the offset from the
address is sufficient for our purposes here (note that taking the offset from
the `MemSegmentOffset` would not be right, as that offset is relative to the
segment start).

This is the exact same issue that was noticed in
37d8029
(in `macaw-aarch32`), but that commit forgot to fix things on the `macaw-ppc`
end.
… types

Now that `macaw-aarch32` and `macaw-ppc` properly handle position-independent
code, the `InstructionAtUnmappedAddr` error (which could only be thrown if an
IP address was found in position-independent code) is never thrown. Let's
delete it.
RyanGlScott added a commit to RyanGlScott/pate that referenced this pull request Nov 14, 2023
@RyanGlScott RyanGlScott merged commit 2e49eb5 into master Nov 14, 2023
3 checks passed
@RyanGlScott RyanGlScott deleted the macaw-ppc-pic-ip-addresses branch November 14, 2023 21:02
danmatichuk pushed a commit to GaloisInc/pate that referenced this pull request Nov 15, 2023
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