Struct object::build::elf::Symbol

source ·
pub struct Symbol<'data, const DYNAMIC: bool = false> {
    pub delete: bool,
    pub name: ByteString<'data>,
    pub section: Option<SectionId>,
    pub st_info: u8,
    pub st_other: u8,
    pub st_shndx: u16,
    pub st_value: u64,
    pub st_size: u64,
    pub version: VersionId,
    pub version_hidden: bool,
    /* private fields */
}
Expand description

A symbol in Symbols.

This corresponds to elf::Sym32 or elf::Sym64.

Fields§

§delete: bool

Ignore this symbol when writing the ELF file.

§name: ByteString<'data>

The name of the symbol.

§section: Option<SectionId>

The section referenced by the symbol.

Used to set the st_shndx field in the ELF symbol.

§st_info: u8

The st_info field in the ELF symbol.

§st_other: u8

The st_other field in the ELF symbol.

§st_shndx: u16

The st_shndx field in the ELF symbol.

Only used if Self::section is None.

§st_value: u64

The st_value field in the ELF symbol.

§st_size: u64

The st_size field in the ELF symbol.

§version: VersionId

GNU version for dynamic symbols.

§version_hidden: bool

Set the elf::VERSYM_HIDDEN flag for this symbol.

Implementations§

source§

impl<'data, const DYNAMIC: bool> Symbol<'data, DYNAMIC>

source

pub fn id(&self) -> SymbolId<DYNAMIC>

The ID used for referring to this symbol.

source

pub fn st_bind(&self) -> u8

Get the st_bind component of the st_info field.

source

pub fn st_type(&self) -> u8

Get the st_type component of the st_info field.

source

pub fn set_st_info(&mut self, st_bind: u8, st_type: u8)

Set the st_info field given the st_bind and st_type components.

Trait Implementations§

source§

impl<'data, const DYNAMIC: bool> Debug for Symbol<'data, DYNAMIC>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'data, const DYNAMIC: bool> Item for Symbol<'data, DYNAMIC>

§

type Id = SymbolId<DYNAMIC>

The type of identifier for the item.
source§

fn is_deleted(&self) -> bool

Return True if the item is deleted.

Auto Trait Implementations§

§

impl<'data, const DYNAMIC: bool> Freeze for Symbol<'data, DYNAMIC>

§

impl<'data, const DYNAMIC: bool> RefUnwindSafe for Symbol<'data, DYNAMIC>

§

impl<'data, const DYNAMIC: bool> Send for Symbol<'data, DYNAMIC>

§

impl<'data, const DYNAMIC: bool> Sync for Symbol<'data, DYNAMIC>

§

impl<'data, const DYNAMIC: bool> Unpin for Symbol<'data, DYNAMIC>

§

impl<'data, const DYNAMIC: bool> UnwindSafe for Symbol<'data, DYNAMIC>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.