pub struct RelocationEntry {
pub ty: RelocationType,
pub offset: u32,
pub index: u32,
pub addend: i64,
}
Expand description
Single relocation entry within a reloc.*
section, as defined at
https://github.com/WebAssembly/tool-conventions/blob/main/Linking.md#relocation-sections.
Fields§
§ty: RelocationType
Relocation entry type.
offset: u32
Offset in bytes from the start of the section indicated by
RelocSectionReader::section
targetted by this relocation.
index: u32
Index in the symbol table contained in the linking section that
corresponds to the value at offset
.
addend: i64
Addend to add to the address, or 0
if not applicable. The value must
be consistent with the self.ty.addend_kind()
.
Implementations§
Source§impl RelocationEntry
impl RelocationEntry
Sourcepub fn relocation_range(&self) -> Range<usize>
pub fn relocation_range(&self) -> Range<usize>
Byte range relative to the start of the section indicated by
RelocSectionReader::section
targetted by this relocation.
Trait Implementations§
Source§impl Clone for RelocationEntry
impl Clone for RelocationEntry
Source§fn clone(&self) -> RelocationEntry
fn clone(&self) -> RelocationEntry
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RelocationEntry
impl Debug for RelocationEntry
Source§impl<'a> FromReader<'a> for RelocationEntry
impl<'a> FromReader<'a> for RelocationEntry
Source§fn from_reader(reader: &mut BinaryReader<'a>) -> Result<Self>
fn from_reader(reader: &mut BinaryReader<'a>) -> Result<Self>
Attempts to read
Self
from the provided binary reader, returning an
error if it is unable to do so.Source§impl Hash for RelocationEntry
impl Hash for RelocationEntry
Source§impl PartialEq for RelocationEntry
impl PartialEq for RelocationEntry
impl Copy for RelocationEntry
impl Eq for RelocationEntry
impl StructuralPartialEq for RelocationEntry
Auto Trait Implementations§
impl Freeze for RelocationEntry
impl RefUnwindSafe for RelocationEntry
impl Send for RelocationEntry
impl Sync for RelocationEntry
impl Unpin for RelocationEntry
impl UnwindSafe for RelocationEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.