-
Notifications
You must be signed in to change notification settings - Fork 37
Cleanup - SBPF version 0x20
#66
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
Conversation
49479e3 to
a1ae297
Compare
src/elf.rs
Outdated
|
|
||
| /// Validates the ELF | ||
| pub fn validate(config: &Config, elf: &Elf64, elf_bytes: &[u8]) -> Result<(), ElfError> { | ||
| pub fn validate(_config: &Config, elf: &Elf64, elf_bytes: &[u8]) -> Result<(), ElfError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about removing the unused parameter?
src/elf.rs
Outdated
| } | ||
| refd_addr | ||
| } else { | ||
| let refd_addr = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the brackets here?
…() as that is only used in Executable::load_with_lenient_parser().
…nable_elf_vaddr().
a1ae297 to
ec9fd17
Compare
src/elf.rs
Outdated
|
|
||
| if text_section | ||
| .file_range() | ||
| .unwrap_or_default() | ||
| .contains(&r_offset) | ||
| || sbpf_version == SBPFVersion::V0 | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the new scope here is necessary. Removing it improves readability. I'm approving the PR, since this shouldn't be a blocker.
| } | ||
| let entry_pc = if let Some(entry_pc) = (offset as usize).checked_div(ebpf::INSN_SIZE) { | ||
| if !sbpf_version.static_syscalls() { | ||
| function_registry.unregister_function(ebpf::hash_symbol_name(b"entrypoint")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, why was this removed? It introduces an unexpected behavioral change when entrypoint is registered multiple times with different PCs. Now, we error out with symbol hash collision, whereas before we would have unregistered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.