Sha256: 7c0d4d10c1055f57184f470aa014e6358394ec95019a74da8d5079d275437d0b

Contents?: true

Size: 1.81 KB

Versions: 24

Compression:

Stored size: 1.81 KB

Contents

//! Support for reading ELF files.
//!
//! Traits are used to abstract over the difference between 32-bit and 64-bit ELF.
//! The primary trait for this is [`FileHeader`].
//!
//! ## High level API
//!
//! [`ElfFile`] implements the [`Object`](crate::read::Object) trait for ELF files.
//! [`ElfFile`] is parameterised by [`FileHeader`] to allow reading both 32-bit and
//! 64-bit ELF. There are type aliases for these parameters ([`ElfFile32`] and
//! [`ElfFile64`]).
//!
//! ## Low level API
//!
//! The [`FileHeader`] trait can be directly used to parse both [`elf::FileHeader32`]
//! and [`elf::FileHeader64`].
//!
//! ### Example for low level API
//!  ```no_run
//! use object::elf;
//! use object::read::elf::{FileHeader, Sym};
//! use std::error::Error;
//! use std::fs;
//!
//! /// Reads a file and displays the name of each symbol.
//! fn main() -> Result<(), Box<dyn Error>> {
//! #   #[cfg(feature = "std")] {
//!     let data = fs::read("path/to/binary")?;
//!     let elf = elf::FileHeader64::<object::Endianness>::parse(&*data)?;
//!     let endian = elf.endian()?;
//!     let sections = elf.sections(endian, &*data)?;
//!     let symbols = sections.symbols(endian, &*data, elf::SHT_SYMTAB)?;
//!     for symbol in symbols.iter() {
//!         let name = symbol.name(endian, symbols.strings())?;
//!         println!("{}", String::from_utf8_lossy(name));
//!     }
//! #   }
//!     Ok(())
//! }
//! ```
#[cfg(doc)]
use crate::elf;

mod file;
pub use file::*;

mod segment;
pub use segment::*;

mod section;
pub use section::*;

mod symbol;
pub use symbol::*;

mod relocation;
pub use relocation::*;

mod comdat;
pub use comdat::*;

mod dynamic;
pub use dynamic::*;

mod compression;
pub use compression::*;

mod note;
pub use note::*;

mod hash;
pub use hash::*;

mod version;
pub use version::*;

mod attributes;
pub use attributes::*;

Version data entries

24 entries across 19 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/object-0.36.7/src/read/elf/mod.rs
wasmtime-28.0.0 ./ext/cargo-vendor/object-0.36.7/src/read/elf/mod.rs
wasmtime-27.0.0 ./ext/cargo-vendor/object-0.36.5/src/read/elf/mod.rs
wasmtime-26.0.0 ./ext/cargo-vendor/object-0.36.5/src/read/elf/mod.rs
wasmtime-25.0.2 ./ext/cargo-vendor/object-0.36.3/src/read/elf/mod.rs
wasmtime-25.0.1 ./ext/cargo-vendor/object-0.36.3/src/read/elf/mod.rs
wasmtime-25.0.0 ./ext/cargo-vendor/object-0.36.3/src/read/elf/mod.rs
wasmtime-24.0.0 ./ext/cargo-vendor/object-0.36.3/src/read/elf/mod.rs
wasmtime-23.0.2 ./ext/cargo-vendor/object-0.36.3/src/read/elf/mod.rs
wasmtime-23.0.2 ./ext/cargo-vendor/object-0.32.2/src/read/elf/mod.rs
wasmtime-22.0.0 ./ext/cargo-vendor/object-0.32.2/src/read/elf/mod.rs
wasmtime-22.0.0 ./ext/cargo-vendor/object-0.36.3/src/read/elf/mod.rs
wasmtime-21.0.1 ./ext/cargo-vendor/object-0.32.2/src/read/elf/mod.rs
wasmtime-21.0.1 ./ext/cargo-vendor/object-0.33.0/src/read/elf/mod.rs
wasmtime-20.0.2 ./ext/cargo-vendor/object-0.33.0/src/read/elf/mod.rs
wasmtime-20.0.2 ./ext/cargo-vendor/object-0.32.2/src/read/elf/mod.rs
wasmtime-20.0.0 ./ext/cargo-vendor/object-0.32.2/src/read/elf/mod.rs
wasmtime-20.0.0 ./ext/cargo-vendor/object-0.33.0/src/read/elf/mod.rs
wasmtime-18.0.3 ./ext/cargo-vendor/object-0.32.2/src/read/elf/mod.rs
wasmtime-17.0.1 ./ext/cargo-vendor/object-0.32.2/src/read/elf/mod.rs