Trait dynasmrt::DynasmLabelApi
source · pub trait DynasmLabelApi: DynasmApi {
type Relocation: Relocation;
Show 13 methods
// Required methods
fn local_label(&mut self, name: &'static str);
fn global_label(&mut self, name: &'static str);
fn dynamic_label(&mut self, id: DynamicLabel);
fn forward_relocation(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: Self::Relocation,
);
fn backward_relocation(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: Self::Relocation,
);
fn global_relocation(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: Self::Relocation,
);
fn dynamic_relocation(
&mut self,
id: DynamicLabel,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: Self::Relocation,
);
fn bare_relocation(
&mut self,
target: usize,
field_offset: u8,
ref_offset: u8,
kind: Self::Relocation,
);
// Provided methods
fn forward_reloc(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding,
) { ... }
fn backward_reloc(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding,
) { ... }
fn global_reloc(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding,
) { ... }
fn dynamic_reloc(
&mut self,
id: DynamicLabel,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding,
) { ... }
fn bare_reloc(
&mut self,
target: usize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding,
) { ... }
}
Expand description
This trait extends DynasmApi to not only allow assembling, but also labels and various directives.
For information on the different kinds of label, consult the common language reference in the dynasm-rs docs.
Required Associated Types§
sourcetype Relocation: Relocation
type Relocation: Relocation
The relocation info type this assembler uses.
Required Methods§
sourcefn local_label(&mut self, name: &'static str)
fn local_label(&mut self, name: &'static str)
Record the definition of a local label
sourcefn global_label(&mut self, name: &'static str)
fn global_label(&mut self, name: &'static str)
Record the definition of a global label
sourcefn dynamic_label(&mut self, id: DynamicLabel)
fn dynamic_label(&mut self, id: DynamicLabel)
Record the definition of a dynamic label
sourcefn forward_relocation(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: Self::Relocation,
)
fn forward_relocation( &mut self, name: &'static str, target_offset: isize, field_offset: u8, ref_offset: u8, kind: Self::Relocation, )
Equivalent of forward_reloc, but takes a non-encoded relocation
sourcefn backward_relocation(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: Self::Relocation,
)
fn backward_relocation( &mut self, name: &'static str, target_offset: isize, field_offset: u8, ref_offset: u8, kind: Self::Relocation, )
Equivalent of backward_reloc, but takes a non-encoded relocation
sourcefn global_relocation(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: Self::Relocation,
)
fn global_relocation( &mut self, name: &'static str, target_offset: isize, field_offset: u8, ref_offset: u8, kind: Self::Relocation, )
Equivalent of global_reloc, but takes a non-encoded relocation
sourcefn dynamic_relocation(
&mut self,
id: DynamicLabel,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: Self::Relocation,
)
fn dynamic_relocation( &mut self, id: DynamicLabel, target_offset: isize, field_offset: u8, ref_offset: u8, kind: Self::Relocation, )
Equivalent of dynamic_reloc, but takes a non-encoded relocation
sourcefn bare_relocation(
&mut self,
target: usize,
field_offset: u8,
ref_offset: u8,
kind: Self::Relocation,
)
fn bare_relocation( &mut self, target: usize, field_offset: u8, ref_offset: u8, kind: Self::Relocation, )
Equivalent of bare_reloc, but takes a non-encoded relocation
Provided Methods§
sourcefn forward_reloc(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding,
)
fn forward_reloc( &mut self, name: &'static str, target_offset: isize, field_offset: u8, ref_offset: u8, kind: <Self::Relocation as Relocation>::Encoding, )
Record a relocation spot for a forward reference to a local label
sourcefn backward_reloc(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding,
)
fn backward_reloc( &mut self, name: &'static str, target_offset: isize, field_offset: u8, ref_offset: u8, kind: <Self::Relocation as Relocation>::Encoding, )
Record a relocation spot for a backward reference to a local label
sourcefn global_reloc(
&mut self,
name: &'static str,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding,
)
fn global_reloc( &mut self, name: &'static str, target_offset: isize, field_offset: u8, ref_offset: u8, kind: <Self::Relocation as Relocation>::Encoding, )
Record a relocation spot for a reference to a global label
sourcefn dynamic_reloc(
&mut self,
id: DynamicLabel,
target_offset: isize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding,
)
fn dynamic_reloc( &mut self, id: DynamicLabel, target_offset: isize, field_offset: u8, ref_offset: u8, kind: <Self::Relocation as Relocation>::Encoding, )
Record a relocation spot for a reference to a dynamic label
sourcefn bare_reloc(
&mut self,
target: usize,
field_offset: u8,
ref_offset: u8,
kind: <Self::Relocation as Relocation>::Encoding,
)
fn bare_reloc( &mut self, target: usize, field_offset: u8, ref_offset: u8, kind: <Self::Relocation as Relocation>::Encoding, )
Record a relocation spot to an arbitrary target.