Struct elf_utilities::symbol::Symbol64 [−][src]
#[repr(C)]pub struct Symbol64 {
pub st_name: Elf64Word,
pub st_info: u8,
pub st_other: u8,
pub st_shndx: Elf64Section,
pub st_value: Elf64Addr,
pub st_size: Elf64Xword,
pub symbol_name: String,
}
Expand description
Symbol64 is a entry of symbol table section.
Symbol64 はシンボルテーブルセクションのエントリである. ELF64で用いることを想定している.
Defaultトレイトを実装しているので,
Default::default()
を呼び出すことで簡単にNULLシンボルを作成できる.
Examples
use elf_utilities::symbol::Symbol64;
let null_sym : Symbol64 = Default::default();
// Symbol64::new_null_symbol() のエイリアスでも作成可能.
let null_sym2 : Symbol64 = Symbol64::new_null_symbol();
assert_eq!(null_sym, null_sym2);
ELFファイルを生成する用途でこのライブラリを使用できるように, バイト列への変換もサポートしている.
Examples
use elf_utilities::symbol::Symbol64;
let null_sym : Symbol64 = Default::default();
// to_le_bytes() を利用してバイト列に変換できる.
let sym_bytes = null_sym.to_le_bytes();
assert_eq!(Symbol64::SIZE, sym_bytes.len())
Fields
st_name: Elf64Word
Symbol name index.
st_info: u8
Information that includes symbol binds and symbol types. symbol typeやsymbol bindを使用する際は,対応するメソッドを使用することを推奨する.
st_other: u8
Symbol’s visibility. See Visibility.
st_shndx: Elf64Section
A section table index that includes the symbol.
st_value: Elf64Addr
Symbol’s value.
st_size: Elf64Xword
Symbol’s size.
symbol_name: String
option member for utilities.
Implementations
NULLシンボルの作成
Set symbol’s information to Symbol64
Examples
use elf_utilities::symbol;
let mut null_sym = symbol::Symbol64::new_null_symbol();
null_sym.set_info(symbol::Type::Func, symbol::Bind::Global);
assert_eq!((1 << 4) | 2, null_sym.st_info);
Create Vec
Examples
use elf_utilities::symbol::Symbol64;
let null_sym : Symbol64 = Default::default();
assert_eq!([0].repeat(Symbol64::SIZE), null_sym.to_le_bytes());
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Symbol64
impl UnwindSafe for Symbol64
Blanket Implementations
Mutably borrows from an owned value. Read more