Skip to main content

elf_loader/relocation/
mod.rs

1//! Relocation configuration, symbol scopes, and binding policy.
2//!
3//! Raw images returned by [`crate::Loader`] become executable through the relocation
4//! pipeline. In practice, most users configure that pipeline with [`Relocator`],
5//! pass the raw image to [`Relocator::run`], then call `relocate()`.
6//!
7//! This module exposes the main customization points used during relocation:
8//!
9//! - [`crate::image::SyntheticModule`] for providing external symbol addresses
10//! - [`crate::observer::RelocationObserver`] for relocation, lifecycle, and
11//!   runtime binding hooks
12//! - [`RelocationEvent`] for inspecting the current relocation and search scope
13//! - binding policy and lazy-fixup support configured through `Relocator`
14
15mod defs;
16mod dynamic;
17mod helper;
18mod relocator;
19mod run;
20mod symbol;
21mod traits;
22
23pub(crate) use defs::{RelocValue, RelocationValueFormula, RelocationValueKind};
24pub(crate) use dynamic::DynamicRelocation;
25pub use dynamic::{relocate_relative, relocate_relr};
26pub(crate) use helper::{BindingDeps, RelocHelper};
27pub(crate) use symbol::{BindingEffect, SymDef, SymbolRegistry, SymbolResolver};
28pub use traits::{ObjectArch, RelocationArch};
29pub(crate) use traits::{Relocatable, RelocateArgs, RelocationValueInput, RelocationValueProvider};
30
31pub use crate::observer::RelocationEvent;
32pub use defs::HandleResult;
33pub use relocator::Relocator;
34pub use run::RelocatorRun;
35pub use traits::{BindingMode, LookupOrder};