Skip to content

Commit

Permalink
Handle R_X86_64_DTPOFF64
Browse files Browse the repository at this point in the history
  • Loading branch information
mikusp committed Feb 19, 2024
1 parent ae65120 commit b3e979d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/kernel/src/rtld/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,19 @@ impl<E: ExecutionEngine> RuntimeLinker<E> {

(Relocated::Tls((md, index)), value)
}
Relocation::R_X86_64_DTPOFF64 => {
let md = match resolver.resolve_with_local(md, sym, symflags) {
Some((md, _)) => md,
None => continue,
};

let sym = md.symbol(sym).unwrap();
let value = unsafe { read_unaligned::<usize>(target.as_ptr().cast()) };

let relocated = (value + sym.value()).wrapping_add_signed(addend);

(Relocated::Data((md, relocated)), relocated)
}
v => return Err(RelocateError::UnsupportedRela(md.path().to_owned(), v)),
};

Expand Down

0 comments on commit b3e979d

Please sign in to comment.