object::read

Trait ObjectSymbol

Source
pub trait ObjectSymbol<'data>: Sealed {
Show 16 methods // Required methods fn index(&self) -> SymbolIndex; fn name_bytes(&self) -> Result<&'data [u8]>; fn name(&self) -> Result<&'data str>; fn address(&self) -> u64; fn size(&self) -> u64; fn kind(&self) -> SymbolKind; fn section(&self) -> SymbolSection; fn is_undefined(&self) -> bool; fn is_definition(&self) -> bool; fn is_common(&self) -> bool; fn is_weak(&self) -> bool; fn scope(&self) -> SymbolScope; fn is_global(&self) -> bool; fn is_local(&self) -> bool; fn flags(&self) -> SymbolFlags<SectionIndex>; // Provided method fn section_index(&self) -> Option<SectionIndex> { ... }
}
Expand description

A symbol table entry.

Required Methods§

Source

fn index(&self) -> SymbolIndex

The index of the symbol.

Source

fn name_bytes(&self) -> Result<&'data [u8]>

The name of the symbol.

Source

fn name(&self) -> Result<&'data str>

The name of the symbol.

Returns an error if the name is not UTF-8.

Source

fn address(&self) -> u64

The address of the symbol. May be zero if the address is unknown.

Source

fn size(&self) -> u64

The size of the symbol. May be zero if the size is unknown.

Source

fn kind(&self) -> SymbolKind

Return the kind of this symbol.

Source

fn section(&self) -> SymbolSection

Returns the section where the symbol is defined.

Source

fn is_undefined(&self) -> bool

Return true if the symbol is undefined.

Source

fn is_definition(&self) -> bool

Return true if the symbol is a definition of a function or data object that has a known address.

Source

fn is_common(&self) -> bool

Return true if the symbol is common data.

Note: does not check for SymbolSection::Section with SectionKind::Common.

Source

fn is_weak(&self) -> bool

Return true if the symbol is weak.

Source

fn scope(&self) -> SymbolScope

Returns the symbol scope.

Source

fn is_global(&self) -> bool

Return true if the symbol visible outside of the compilation unit.

This treats SymbolScope::Unknown as global.

Source

fn is_local(&self) -> bool

Return true if the symbol is only visible within the compilation unit.

Source

fn flags(&self) -> SymbolFlags<SectionIndex>

Symbol flags that are specific to each file format.

Provided Methods§

Source

fn section_index(&self) -> Option<SectionIndex>

Returns the section index for the section containing this symbol.

May return None if the symbol is not defined in a section.

Implementors§

Source§

impl<'data, 'file, Elf: FileHeader, R: ReadRef<'data>> ObjectSymbol<'data> for ElfSymbol<'data, 'file, Elf, R>

Source§

impl<'data, 'file, Mach, R> ObjectSymbol<'data> for MachOSymbol<'data, 'file, Mach, R>
where Mach: MachHeader, R: ReadRef<'data>,

Source§

impl<'data, 'file, R: ReadRef<'data>> ObjectSymbol<'data> for CoffSymbol<'data, 'file, R>

Source§

impl<'data, 'file, R: ReadRef<'data>> ObjectSymbol<'data> for Symbol<'data, 'file, R>