Trait object::read::traits::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, SymbolIndex>; // Provided method fn section_index(&self) -> Option<SectionIndex> { ... }
}
Expand description

A symbol table entry in an Object.

This trait is part of the unified read API.

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.

This is primarily used to implement Object::symbol_map.

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, SymbolIndex>

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 Symbol<'data, 'file, R>

source§

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

source§

impl<'data, 'file, Xcoff: FileHeader, R: ReadRef<'data>> ObjectSymbol<'data> for XcoffSymbol<'data, 'file, Xcoff, R>