pub struct SymbolDesc {
pub name: String,
pub sym_type: SymbolType,
pub scope: SymbolScope,
pub content: Option<Content>,
pub size: Option<u64>,
}Expand description
Description of an ELF symbol to be generated.
Fields§
§name: StringName of the symbol.
sym_type: SymbolTypeType of the symbol (Func, Object, etc.).
scope: SymbolScopeScope of the symbol (Global, Local, etc.).
content: Option<Content>Optional content associated with the symbol.
size: Option<u64>Optional size of the symbol. If None, it may be calculated from content.
Implementations§
Source§impl SymbolDesc
impl SymbolDesc
Sourcepub fn global_func(name: impl Into<String>, code: &[u8]) -> Self
pub fn global_func(name: impl Into<String>, code: &[u8]) -> Self
Create a global function symbol with associated code.
Sourcepub fn global_object(name: impl Into<String>, data: &[u8]) -> Self
pub fn global_object(name: impl Into<String>, data: &[u8]) -> Self
Create a global data object symbol.
Sourcepub fn undefined_func(name: impl Into<String>) -> Self
pub fn undefined_func(name: impl Into<String>) -> Self
Create an undefined function symbol.
Sourcepub fn undefined_object(name: impl Into<String>) -> Self
pub fn undefined_object(name: impl Into<String>) -> Self
Create an undefined data object symbol.
Sourcepub fn global_tls(name: impl Into<String>, data: &[u8]) -> Self
pub fn global_tls(name: impl Into<String>, data: &[u8]) -> Self
Create a global TLS symbol with associated data.
Sourcepub fn undefined_tls(name: impl Into<String>) -> Self
pub fn undefined_tls(name: impl Into<String>) -> Self
Create an undefined TLS symbol.
Sourcepub fn plt_func(name: impl Into<String>, code: Vec<u8>) -> Self
pub fn plt_func(name: impl Into<String>, code: Vec<u8>) -> Self
Create a function symbol located in the PLT section.
Sourcepub fn with_scope(self, scope: SymbolScope) -> Self
pub fn with_scope(self, scope: SymbolScope) -> Self
Set a custom scope for the symbol.
Trait Implementations§
Source§impl Clone for SymbolDesc
impl Clone for SymbolDesc
Source§fn clone(&self) -> SymbolDesc
fn clone(&self) -> SymbolDesc
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 SymbolDesc
impl RefUnwindSafe for SymbolDesc
impl Send for SymbolDesc
impl Sync for SymbolDesc
impl Unpin for SymbolDesc
impl UnwindSafe for SymbolDesc
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