1pub mod elf;
8pub mod layout;
9pub mod linker;
10
11use thiserror::Error;
12
13#[derive(Error, Debug)]
14pub enum TranspileError {
15 #[error("ELF parse error: {0}")]
16 ElfParse(String),
17 #[error("unsupported RISC-V instruction at offset {offset:#x}: {detail}")]
18 UnsupportedInstruction { offset: usize, detail: String },
19 #[error("unsupported relocation: {0}")]
20 UnsupportedRelocation(String),
21 #[error("register mapping error: RISC-V register {0} has no PVM equivalent")]
22 RegisterMapping(u8),
23 #[error("code too large: {0} bytes")]
24 CodeTooLarge(usize),
25 #[error("invalid section: {0}")]
26 InvalidSection(String),
27}