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

Loading ELF files #138

Merged
merged 8 commits into from
Apr 8, 2024
Merged

Loading ELF files #138

merged 8 commits into from
Apr 8, 2024

Conversation

morganthomas
Copy link
Collaborator

Closes: #135

@morganthomas morganthomas marked this pull request as ready for review April 5, 2024 17:44
basic/src/bin/valida.rs Outdated Show resolved Hide resolved
&& section_header.sh_flags == (abi::SHF_ALLOC | abi::SHF_WRITE).into();
let is_text: bool = section_header.sh_type == abi::SHT_PROGBITS
&& section_header.sh_flags == (abi::SHF_ALLOC | abi::SHF_EXECINSTR).into();
let is_useful: bool = is_data || is_bss || is_text;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is needed. I've removed this in https://github.com/valida-xyz/valida/pull/145/files and confirmed it works.

Copy link
Collaborator

@thealmarty thealmarty left a comment

Choose a reason for hiding this comment

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

I've fix some warnings and remove is_useful in https://github.com/valida-xyz/valida/pull/145/files. Please merge that before merging this if you are fine with that. Thanks!

@morganthomas
Copy link
Collaborator Author

Thanks @thealmarty ! The is_useful boolean is there in case there is any other section type in the file besides the ones we know how to parse. This may not happen with the cases you looked at, but it can happen.

@morganthomas morganthomas merged commit 3fcc93b into main Apr 8, 2024
2 checks passed
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.

Load ELF object files
2 participants