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

Initial SHT_RELR support #746

Merged
merged 5 commits into from
Dec 1, 2024
Merged

Initial SHT_RELR support #746

merged 5 commits into from
Dec 1, 2024

Conversation

philipc
Copy link
Contributor

@philipc philipc commented Nov 29, 2024

This adds a low level API for reading SHT_RELR relocations, and changes the ELF builder to copy the section.

This doesn't add the relocations to the read::Object trait. It's not clear what the best way to support this is. Adding them into Object::dynamic_relocations would require synthesizing fields of the Relocation. An alternative is to add a new method, and perhaps this method could cover PE base relocations (which are also not currently handled by the read::Object trait). This can wait until someone has a use case for these so that it can be tested properly.

In the future, the ELF builder may need to support modifying the relocations. The difficulty with this is that the relocations would need to be encoded again before doing layout. Again, this can wait until someone has a use case for this. This is the same as the existing support for various other sections.

Closes #722, closes #744 (cc @bjorn3, @fg-scontain)

For now we just pass the data through unmodified. In the future,
we may need to parse the relocations (e.g. to update relocations
for sections that have been changed).
This is still missing an encoder for the relocations.
@philipc philipc merged commit 01c8b19 into gimli-rs:master Dec 1, 2024
10 checks passed
@philipc philipc deleted the issue-722 branch December 1, 2024 03:52
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.

Support ELF .relr relocations
1 participant