diff --git a/src/elf.rs b/src/elf.rs index d0c156c0..01941927 100644 --- a/src/elf.rs +++ b/src/elf.rs @@ -117,7 +117,7 @@ impl From for ElfError { | ElfParserError::InvalidString | ElfParserError::InvalidSize | ElfParserError::Overlap - | ElfParserError::SectionNotInOrder + | ElfParserError::NotInOrder | ElfParserError::NoSectionNameStringTable | ElfParserError::InvalidDynamicSectionTable | ElfParserError::InvalidRelocationTable @@ -469,7 +469,7 @@ impl Executable { 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); diff --git a/src/elf_parser/mod.rs b/src/elf_parser/mod.rs index 21499701..d6e27203 100644 --- a/src/elf_parser/mod.rs +++ b/src/elf_parser/mod.rs @@ -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, @@ -230,7 +230,7 @@ impl<'a> Elf64<'a> { check_that_there_is_no_overlap(§ion_range, &program_header_table_range)?; check_that_there_is_no_overlap(§ion_range, §ion_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);