Open
Conversation
…tionHeaderTable.into_iter()` & type alias
…nto SectionHeaderTable
…with an extension trait for elf::section::SectionHeader
…tionsTag was set to an invalid entry size causing the test to fail
… `ElfSectionFlags`
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.
This is a complete rewrite from #290, using
elf::sections::SectionHeaderTableto construct the iterator. Unlike #290 however, I decided not to care about version compatibility. This removes or replaces a number of existing functions.One change in particular is how to fetch the section name. The existing method in my opinion is flawed, if the ELF sections are relocated then it's not possible to get the name. I've changed this so the string table must be fetched separately, which can then be passed to a helper. This helper returns a
&core::ffi::CStrinstead of a&str, the ELF specification doesn't define the character encoding so we should not force it to be Unicode.An important behavioral change that isn't obvious is that "unused" (
SHT_NULL) sections are no longer skipped. This threw me for a loop during testing. If they're there it's probably there for a reason, so I think its a bad idea to skip it, especially if you can just use.filter(_).