pub struct RelocEntry {
pub symbol_name: String,
pub r_type: RelocType,
pub addend: i64,
}Expand description
Represents a relocation entry to be generated.
Fields§
§symbol_name: StringSymbol name that this relocation references.
r_type: RelocTypeArchitecture-specific relocation type.
addend: i64Addend for the relocation.
Implementations§
Source§impl RelocEntry
impl RelocEntry
Sourcepub fn with_name(symbol_name: impl Into<String>, r_type: u32) -> Self
pub fn with_name(symbol_name: impl Into<String>, r_type: u32) -> Self
Create a new relocation entry referencing a symbol.
Sourcepub fn new(r_type: u32) -> Self
pub fn new(r_type: u32) -> Self
Create a new relocation entry without a symbol reference (e.g., RELATIVE).
Sourcepub fn with_addend(self, addend: i64) -> Self
pub fn with_addend(self, addend: i64) -> Self
Set the addend for the relocation.
Sourcepub fn jump_slot(symbol_name: impl Into<String>, arch: Arch) -> Self
pub fn jump_slot(symbol_name: impl Into<String>, arch: Arch) -> Self
Create a JUMP_SLOT relocation for the given architecture.
Sourcepub fn glob_dat(symbol_name: impl Into<String>, arch: Arch) -> Self
pub fn glob_dat(symbol_name: impl Into<String>, arch: Arch) -> Self
Create a GLOB_DAT relocation for the given architecture.
Sourcepub fn irelative(arch: Arch) -> Self
pub fn irelative(arch: Arch) -> Self
Create an IRELATIVE relocation for the given architecture.
Sourcepub fn copy(symbol_name: impl Into<String>, arch: Arch) -> Self
pub fn copy(symbol_name: impl Into<String>, arch: Arch) -> Self
Create a COPY relocation for the given architecture.
Sourcepub fn dtpoff(symbol_name: impl Into<String>, arch: Arch) -> Self
pub fn dtpoff(symbol_name: impl Into<String>, arch: Arch) -> Self
Create a DTPOFF relocation for the given architecture.
Trait Implementations§
Source§impl Clone for RelocEntry
impl Clone for RelocEntry
Source§fn clone(&self) -> RelocEntry
fn clone(&self) -> RelocEntry
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for RelocEntry
impl RefUnwindSafe for RelocEntry
impl Send for RelocEntry
impl Sync for RelocEntry
impl Unpin for RelocEntry
impl UnwindSafe for RelocEntry
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