refactor Reloc to an enum of every architecture's reloc types
https://github.com/stoklund/cretonne/pull/206#issuecomment-350905016
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
a888b2a6f1
commit
88b30ff386
@@ -9,26 +9,6 @@ use super::registers::RU;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/binemit-intel.rs"));
|
||||
|
||||
/// Intel relocations.
|
||||
pub enum RelocKind {
|
||||
/// A 4-byte relative function reference. Based from relocation + 4 bytes.
|
||||
PCRel4,
|
||||
|
||||
/// A 4-byte absolute function reference.
|
||||
Abs4,
|
||||
|
||||
/// An 8-byte absolute function reference.
|
||||
Abs8,
|
||||
}
|
||||
|
||||
pub static RELOC_NAMES: [&'static str; 3] = ["PCRel4", "Abs4", "Abs8"];
|
||||
|
||||
impl Into<Reloc> for RelocKind {
|
||||
fn into(self) -> Reloc {
|
||||
Reloc(self as u16)
|
||||
}
|
||||
}
|
||||
|
||||
// Convert a stack base to the corresponding register.
|
||||
fn stk_base(base: StackBase) -> RegUnit {
|
||||
let ru = match base {
|
||||
|
||||
Reference in New Issue
Block a user