Skip to content

Commit

Permalink
Renames ElfParserError::SectionNotInOrder => ElfParserError::NotInOrder.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Oct 16, 2024
1 parent eebc745 commit b8b1a69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl From<ElfParserError> for ElfError {
| ElfParserError::InvalidString
| ElfParserError::InvalidSize
| ElfParserError::Overlap
| ElfParserError::SectionNotInOrder
| ElfParserError::NotInOrder
| ElfParserError::NoSectionNameStringTable
| ElfParserError::InvalidDynamicSectionTable
| ElfParserError::InvalidRelocationTable
Expand Down Expand Up @@ -469,7 +469,7 @@ impl<C: ContextObject> Executable<C> {
return Err(ElfParserError::InvalidSize);
}
if symbol.st_value != expected_symbol_address {
return Err(ElfParserError::SectionNotInOrder);
return Err(ElfParserError::NotInOrder);
}
if symbol.st_value.checked_rem(ebpf::INSN_SIZE as u64) != Some(0) {
return Err(ElfParserError::InvalidAlignment);
Expand Down
8 changes: 4 additions & 4 deletions src/elf_parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ pub enum ElfParserError {
/// Headers, tables or sections do overlap in the file
#[error("values overlap")]
Overlap,
/// Sections are not sorted in ascending order
#[error("sections not in ascending order")]
SectionNotInOrder,
/// Tables or sections are not sorted in ascending order
#[error("values not in ascending order")]
NotInOrder,
/// No section name string table present in the file
#[error("no section name string table found")]
NoSectionNameStringTable,
Expand Down Expand Up @@ -230,7 +230,7 @@ impl<'a> Elf64<'a> {
check_that_there_is_no_overlap(&section_range, &program_header_table_range)?;
check_that_there_is_no_overlap(&section_range, &section_header_table_range)?;
if section_range.start < offset {
return Err(ElfParserError::SectionNotInOrder);
return Err(ElfParserError::NotInOrder);
}
if section_range.end > elf_bytes.len() {
return Err(ElfParserError::OutOfBounds);
Expand Down

0 comments on commit b8b1a69

Please sign in to comment.