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

Add RISC-V relocation types #45

Merged
merged 2 commits into from
Jul 30, 2024
Merged

Conversation

RyanGlScott
Copy link
Contributor

Fixes #36.

@RyanGlScott RyanGlScott requested review from Ptival and kquick July 30, 2024 09:43
Copy link
Member

@kquick kquick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. I would recommend switching to error for the relocation fields that aren't presently handled correctly though.

src/Data/ElfEdit/Relocations/RISCV.hs Outdated Show resolved Hide resolved
This applies to both the PowerPC and RISC-V architectures, both of which have
tricky relocation types that `elf-edit` does not currently support. See #39 for
more information.
@RyanGlScott RyanGlScott merged commit fcda0a5 into main Jul 30, 2024
3 checks passed
@RyanGlScott RyanGlScott deleted the T36-RISC-V-relocation-types branch July 30, 2024 17:25
RyanGlScott added a commit to GaloisInc/macaw that referenced this pull request Jul 30, 2024
This builds on top of the work in GaloisInc/elf-edit#45. For now, I only add
support for a select few relocation types, leaving the rest as future work.

This paves a way for an eventual fix for #414.
RyanGlScott added a commit to GaloisInc/macaw that referenced this pull request Jul 30, 2024
Now that we can load RISC-V relocations in `macaw` (building on top of the work
in GaloisInc/elf-edit#45), this patch adds PLT stub heuristics for RISC-V
binaries. I have added some test cases in `macaw-riscv-symbolic` which
demonstrate that the basic idea works.

Note that due to #416, these test cases will print warnings when loaded into
`macaw`. These warnings are ultimately harmless, however, as the same
relocations are loaded at the same addresses multiple times, which causes no
change in behavior.

Fixes #414.
RyanGlScott added a commit to GaloisInc/macaw that referenced this pull request Jul 31, 2024
This builds on top of the work in GaloisInc/elf-edit#45. For now, I only add
support for a select few relocation types, leaving the rest as future work.

This paves a way for an eventual fix for #414.
RyanGlScott added a commit to GaloisInc/macaw that referenced this pull request Jul 31, 2024
Now that we can load RISC-V relocations in `macaw` (building on top of the work
in GaloisInc/elf-edit#45), this patch adds PLT stub heuristics for RISC-V
binaries. I have added some test cases in `macaw-riscv-symbolic` which
demonstrate that the basic idea works.

Note that due to #416, these test cases will print warnings when loaded into
`macaw`. These warnings are ultimately harmless, however, as the same
relocations are loaded at the same addresses multiple times, which causes no
change in behavior.

Fixes #414.
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.

Add RISC-V relocation types
2 participants