-
Notifications
You must be signed in to change notification settings - Fork 23
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
Architecture Specific Relocations + 32bit Support #30
Merged
Conversation
This file contains 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
…en RelocationType::from fails
Staging PR for addition of 32bit support and arch-specific relocation types.
This looks awesome, thanks for the contribution! I will review this over the next few days when I have some time. |
…ready contained in rtype.
No problem! |
release as 0.15, many thanks for the great contribution! |
Thanks! |
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.
@gz Here is the full PR for #29. It ended up being larger than I originally planned so if you prefer I try to split it up into multiple just let me know.
Adds
RelocationEntry
struct to abstract 32bit and 64bitRela<T>
/Rel<T>
entries.Which is then passed to the user via the
relocate()
function in the exposed trait interface:Architecture specific relocation types are added into
./arch/[ARCH].rs
and can be handled in a single match statement by the user by adding ause
for the architectures they'd like to handle:Change summaries:
ElfBinary::get_arch()
ElfBinary::interpreter()
load_pie_elf_32()
,check_nopie_32()
, andcheck_tls_32()
ElBinary::maybe_relocate()
to handleSectionData::Rela32
,SectionData::Rel32
, andSectionData::Rel64
and pass the abstractedRelocationEntry
object toloader.relocate()
ElfBinary::parse_dynamic()
to handle 32bitSegmentData::Dynamic32
ElfBinary::load()
to handle 32bitProgramHeader::Ph32
ElfBinary::iter_loadable_headers()
to handle 32bitProgramHeader::Ph32
ElfBinary::new()
to handle 32bitProgramHeader::Ph32
Repo structure changes:
src/test.rs
ElfBinary
code tosrc/binary.rs
src/arch/*
for architecture specific Relocation definitions