#[derive(Debug)]
pub struct Stencil {
pub name: &'static str,
pub code: &'static [u8],
pub relocs: &'static [Reloc],
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Reloc {
pub offset: u32,
pub kind: RelocKind,
pub target: HoleId,
pub addend: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RelocKind {
Branch26,
Page21,
PageOff12 {
scale: u8,
},
GotPage21,
GotPageOff12,
Rel32,
GotRel32,
Abs64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum HoleId {
Cont(u8),
ConstI64(u8),
}