use core::fmt::{Display, Formatter, Result};
use elf::{compression::CompressionHeader, ParseError};
#[derive(Debug)]
pub enum Error {
ErrorParsingELF(ParseError),
NoSegmentForSection(usize),
InvalidInstruction(u32),
InvalidInstructionSize(usize),
InvalidPlatform,
NoSectionHeader,
NoProgramHeader,
BufferTooSmall,
UnsupportedCompression(CompressionHeader),
}
impl core::error::Error for Error {}
impl Display for Error {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
write!(f, "{self:?}")
}
}
impl From<ParseError> for Error {
fn from(e: ParseError) -> Self {
Error::ErrorParsingELF(e)
}
}