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

elf: parse shdr_relocs even if binary type is not ET_REL #118

Merged
merged 2 commits into from
Feb 9, 2019

Conversation

Techno-coder
Copy link
Contributor

Fixes #117

Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks and appreciate your contribution :) I’ll try to push a new version ASAP

src/elf/mod.rs Outdated
}
let mut shdr_relocs = vec![];
for (idx, section) in section_headers.iter().enumerate() {
if section.sh_type == section_header::SHT_REL {
Copy link
Owner

@m4b m4b Feb 8, 2019

Choose a reason for hiding this comment

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

Random thought, you don’t have to do it, wish we just did:

let is_rela = section.sh_type == section_header::SHT_RELA
if is_rela || section.sh_type == section_header::SHT_REL {
  // code and pass is_rela to the Boolean flag in parse
}

Copy link
Contributor Author

@Techno-coder Techno-coder Feb 8, 2019

Choose a reason for hiding this comment

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

Yes, that seems like a good idea and it's what I have in my work around for section relocations

@m4b m4b merged commit b1c7f0d into m4b:master Feb 9, 2019
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.

2 participants