diff --git a/src/elf.rs b/src/elf.rs index 6aac512f..ddbe99ae 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 @@ -475,7 +475,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 cb5934eb..d936d882 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, @@ -222,7 +222,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); } offset = section_range.end; if offset > elf_bytes.len() {