Skip to main content

dyn_addr

Function dyn_addr 

Source
fn dyn_addr(base: usize, v: u64) -> usize
Expand description

Turn a DT_* d_ptr into an absolute address across libc implementations that disagree on what it holds: glibc pre-relocates these pointers to absolute, while musl leaves them file-relative, so the patch cannot assume either. The heuristic treats a value below the load base as a relative offset to add to base, and a value at or above base as already absolute.