#[repr(C)]pub struct HeaderIdent {
pub magic: [u8; 4],
pub class: FileClass,
pub endianness: Endianness,
pub header_version: u8,
pub os_abi: OSABI,
pub os_abi_version: u8,
/* private fields */
}
Expand description
Initial header which has the same layout in all ELF variants and determines how to interpret the rest of the file (endianness, sizes).
Fields§
§magic: [u8; 4]
Magic number that identifies this as an ELF file.
class: FileClass
Specifies the address size (32- or 64-bit) of the file.
endianness: Endianness
Specifies whether the file uses big or little endian byte ordering.
header_version: u8
Version of the ELF header.
os_abi: OSABI
Operating-system-specific ABI extensions that this file uses.
os_abi_version: u8
Backwards-incompatible version number of the os_abi
extensions
that this file uses.
Implementations§
Source§impl HeaderIdent
impl HeaderIdent
Sourcepub const VERSION: u8 = 1u8
pub const VERSION: u8 = 1u8
Expected value of the header_version
field.
Sourcepub fn verify_format(&self)
pub fn verify_format(&self)
Checks that the header represents a valid ELF file, of any variant, and panics otherwise.
§Panics
Panics when the header is not valid.
Sourcepub fn verify_native(&self)
pub fn verify_native(&self)
Checks that the header represents an ELF file in the native endianness and address size, and panics otherwise.
§Panics
Panics when the header is not valid for the current platform.
Trait Implementations§
Source§impl Clone for HeaderIdent
impl Clone for HeaderIdent
Source§fn clone(&self) -> HeaderIdent
fn clone(&self) -> HeaderIdent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more