From 20f2e6a916d8ce6d3d7e6ef3bf47ff9f63d7bde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Wed, 16 Oct 2024 09:29:46 +0100 Subject: [PATCH] Renames ElfParserError::SectionNotInOrder => ElfParserError::NotInOrder. --- src/elf.rs | 4 ++-- src/elf_parser/mod.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/elf.rs b/src/elf.rs index b1f8a3517..1d433baef 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 @@ -465,7 +465,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 214997013..d6e272038 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);