Skip to content

Commit

Permalink
Merge branch 'main' into sys-593
Browse files Browse the repository at this point in the history
  • Loading branch information
SuchAFuriousDeath committed Feb 24, 2024
2 parents 2c8b500 + e9c6e01 commit 226a9d3
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 @@ -857,6 +857,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 226a9d3

Please sign in to comment.