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シンボルの作成

for utilities

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 from Symbol64’s each fields.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.