elf: add .relr.dyn bootstrap relocation support#69
Merged
fwsGonzo merged 3 commits intovarnish:masterfrom Apr 5, 2026
Merged
Conversation
This was referenced Apr 2, 2026
fwsGonzo
requested changes
Apr 4, 2026
| { | ||
| const unsigned bit = __builtin_ctzll(bits); | ||
| const address_t reloc_addr = where + bit * sizeof(address_t); | ||
| if (memory.safely_within(reloc_addr, sizeof(address_t))) { |
Member
There was a problem hiding this comment.
This might be a place where we want to fail hard if there is an out-of-bounds address, throwing a MachineException instead of silently ignoring it.
d584a8a to
9082091
Compare
Contributor
Author
|
Thank you for the feedback. That was a miss on my part. I rebased this branch onto current master and resolved the merge conflict in machine_elf.cpp. I also addressed the review feedback to fail hard on out-of-bounds RELR writes instead of silently ignoring them:
After the rebase + force-push, PR #69 is now mergeable again (GitHub conflict state cleared). |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.relr.dynbootstrap relocation decoding/application and declaration wiring.Why
Validation
cd tests && bash run_unit_tests.sh -R test_elfDepends on
Stack Context
Test Evidence
cd tests && bash run_unit_tests.sh-> 8/8 passed(cd guest/tests && bash build.sh) && ./build/tinytest guest/tests/glibc_test-> passedPR-Scoped Command
cd tests && bash run_unit_tests.sh -R test_elf