mod stack_map;
pub use self::stack_map::StackMap;
use core::fmt;
#[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize};
pub type CodeOffset = u32;
pub type Addend = i64;
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub enum Reloc {
Abs4,
Abs8,
X86PCRel4,
X86CallPCRel4,
X86CallPLTRel4,
X86GOTPCRel4,
X86SecRel,
Arm32Call,
Arm64Call,
S390xPCRel32Dbl,
S390xPLTRel32Dbl,
ElfX86_64TlsGd,
MachOX86_64Tlv,
Aarch64TlsGdAdrPage21,
Aarch64TlsGdAddLo12Nc,
RiscvCall,
S390xTlsGd64,
S390xTlsGdCall,
}
impl fmt::Display for Reloc {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
Self::Abs4 => write!(f, "Abs4"),
Self::Abs8 => write!(f, "Abs8"),
Self::S390xPCRel32Dbl => write!(f, "PCRel32Dbl"),
Self::S390xPLTRel32Dbl => write!(f, "PLTRel32Dbl"),
Self::X86PCRel4 => write!(f, "PCRel4"),
Self::X86CallPCRel4 => write!(f, "CallPCRel4"),
Self::X86CallPLTRel4 => write!(f, "CallPLTRel4"),
Self::X86GOTPCRel4 => write!(f, "GOTPCRel4"),
Self::X86SecRel => write!(f, "SecRel"),
Self::Arm32Call | Self::Arm64Call => write!(f, "Call"),
Self::RiscvCall => write!(f, "RiscvCall"),
Self::ElfX86_64TlsGd => write!(f, "ElfX86_64TlsGd"),
Self::MachOX86_64Tlv => write!(f, "MachOX86_64Tlv"),
Self::Aarch64TlsGdAdrPage21 => write!(f, "Aarch64TlsGdAdrPage21"),
Self::Aarch64TlsGdAddLo12Nc => write!(f, "Aarch64TlsGdAddLo12Nc"),
Self::S390xTlsGd64 => write!(f, "TlsGd64"),
Self::S390xTlsGdCall => write!(f, "TlsGdCall"),
}
}
}
#[derive(Debug, PartialEq)]
pub struct CodeInfo {
pub total_size: CodeOffset,
}