#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SectionKind {
Unknown,
Text,
Data,
ReadOnlyData,
ReadOnlyString,
UninitializedData,
Common,
Tls,
UninitializedTls,
TlsVariables,
OtherString,
Other,
Debug,
Linker,
Metadata,
}
impl SectionKind {
pub fn is_bss(self) -> bool {
self == SectionKind::UninitializedData
|| self == SectionKind::UninitializedTls
|| self == SectionKind::Common
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SymbolKind {
Unknown,
Null,
Text,
Data,
Section,
File,
Label,
Tls,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SymbolScope {
Unknown,
Compilation,
Linkage,
Dynamic,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RelocationKind {
Absolute,
Relative,
Got,
GotRelative,
GotBaseRelative,
GotBaseOffset,
PltRelative,
ImageOffset,
SectionOffset,
SectionIndex,
Elf(u32),
MachO {
value: u8,
relative: bool,
},
Coff(u16),
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum RelocationEncoding {
Generic,
X86Signed,
X86RipRelative,
X86RipRelativeMovq,
X86Branch,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FileFlags {
None,
Elf {
e_flags: u32,
},
MachO {
flags: u32,
},
Coff {
characteristics: u16,
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SectionFlags {
None,
Elf {
sh_flags: u64,
},
MachO {
flags: u32,
},
Coff {
characteristics: u32,
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SymbolFlags<Section> {
None,
Elf {
st_info: u8,
st_other: u8,
},
MachO {
n_desc: u16,
},
CoffSection {
selection: u8,
associative_section: Section,
},
}