1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! Zero-copy ELF reading.
//!
//! **Workstream W7.** This module parses relocatable objects and shared
//! objects straight out of the input mapping:
//!
//! - [`format`](mod@format): the [`ElfFormat`] trait and its four instantiations
//! ([`Elf64Le`], [`Elf64Be`], [`Elf32Le`], [`Elf32Be`]), plus [`ElfKind`]
//! for run-time identification. Every reader is generic over the format,
//! so hot loops are monomorphized and never branch on class or byte order.
//! - [`ElfFile`]: header validation, section and program header tables
//! (with extended section numbering), section names and contents.
//! - [`ObjectFile`]: `ET_REL` objects — symbols ([`SymbolTable`]),
//! relocations ([`RelaSlice`], [`RelSlice`], [`RelrSlice`]), groups
//! ([`Group`]), GNU properties ([`GnuProperties`]), compression headers,
//! `.eh_frame` splitting ([`split_eh_frame`]) and GCC LTO detection.
//! - [`SharedObject`]: `ET_DYN` objects — `.dynamic`, `DT_SONAME`,
//! `DT_NEEDED`, `.dynsym` and symbol versions.
//! - [`consts`]: ELF ABI constants and relocation type names.
//!
//! # Safety and robustness
//!
//! Input is untrusted. Records are byte arrays of alignment 1, decoded with
//! `from_le_bytes`/`from_be_bytes`; there is no `unsafe` and no pointer
//! cast. Every offset and size is bounds-checked with checked arithmetic
//! (this module denies `clippy::arithmetic_side_effects`), and problems are
//! reported as [`Error::Malformed`](crate::Error::Malformed) naming the file
//! and offset.
//!
//! # Performance model
//!
//! Parsing an object reads its section headers once and allocates nothing.
//! Symbols and relocations are decoded one entry at a time by iterators over
//! the mapped bytes. Symbol names are returned as `&'a [u8]` slices, ready
//! for prehashed interning by the caller.
//!
//! # Limitations
//!
//! - MIPS64 little-endian relocations, whose `r_info` layout differs from
//! every other target, are decoded with the generic layout.
//! - Shared objects are read through their section headers; without them
//! only the dynamic array (via `PT_DYNAMIC`) is available.
pub use ;
pub use ;
pub use ElfFile;
pub use ;
pub use Group;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use Source;
pub use StringTable;
pub use ;