pub struct SymbolRef<'a> { /* private fields */ }Implementations§
Source§impl<'a> SymbolRef<'a>
impl<'a> SymbolRef<'a>
Sourcepub fn name(&self) -> Result<&'a str>
pub fn name(&self) -> Result<&'a str>
Examples found in repository?
examples/basic.rs (line 23)
3fn main() -> elflib::Result<()> {
4 // let mut content = std::fs::read("/lib/modules/6.2.0-34-generic/kernel/net/nfc/nfc.ko").unwrap();
5 // let mut content = std::fs::read("/usr/bin/ls").unwrap();
6 let mut content =
7 std::fs::read("./test_binaries/build/mips64-linux-gnuabi64-gcc-main").unwrap();
8
9 let parser = ElfParser::new(&mut content)?;
10 let sections = parser.section_headers()?;
11 for section_res in sections {
12 let section = section_res?;
13 match section.data()? {
14 elflib::SectionData::RelocationSection(rel_section) => {
15 for rel_entry_res in rel_section.entries {
16 let rel_entry = rel_entry_res?;
17 println!("{:?}", rel_entry);
18 }
19 }
20 elflib::SectionData::SymbolTable(symbol_entries) => {
21 for symbol_res in symbol_entries {
22 let symbol = symbol_res?;
23 println!("{:?}", symbol.name());
24 }
25 }
26 _ => {}
27 }
28 }
29 Ok(())
30}pub fn section(&self) -> Result<SymbolSection<'a>>
Methods from Deref<Target = Symbol>§
pub fn info(&self) -> &SymbolInfo
pub fn name_index_in_string_table(&self) -> u32
pub fn other_info(&self) -> &SymbolOtherInfo
pub fn size(&self) -> u64
pub fn value(&self) -> u64
Trait Implementations§
Source§impl<'a> VariantStructBinarySerde<'a> for SymbolRef<'a>
impl<'a> VariantStructBinarySerde<'a> for SymbolRef<'a>
type Context = SymbolRefContext<'a>
fn deserialize( deserializer: &mut BinaryDeserializerFromBufSafe<'a>, parser: &ElfParser<'a>, context: SymbolRefContext<'a>, ) -> Result<Self, BinarySerdeBufSafeError>
fn record_len(file_info: &ElfFileInfo) -> usize
fn serialize(&self, buf: &mut [u8], endianness: Endianness)
Auto Trait Implementations§
impl<'a> Freeze for SymbolRef<'a>
impl<'a> RefUnwindSafe for SymbolRef<'a>
impl<'a> Send for SymbolRef<'a>
impl<'a> Sync for SymbolRef<'a>
impl<'a> Unpin for SymbolRef<'a>
impl<'a> UnwindSafe for SymbolRef<'a>
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