Skip to content
Snippets Groups Projects
Verified Commit ecd93495 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

R_X86_64_TPOFF64 does not require symbol, allow it to be unset

parent e90fa3e3
No related branches found
No related tags found
No related merge requests found
...@@ -398,10 +398,14 @@ impl Linker { ...@@ -398,10 +398,14 @@ impl Linker {
set_u64((b + a) as u64); set_u64((b + a) as u64);
} }
reloc::R_X86_64_TPOFF64 => { reloc::R_X86_64_TPOFF64 => {
let sym = symbol if rel.r_sym > 0 {
.as_ref() let sym = symbol
.expect("R_X86_64_TPOFF64 called without valid symbol"); .as_ref()
set_u64((sym.value + a).wrapping_sub(t) as u64); .expect("R_X86_64_TPOFF64 called without valid symbol");
set_u64((sym.value + a).wrapping_sub(t) as u64);
} else {
set_u64(a.wrapping_sub(t) as u64);
}
} }
reloc::R_X86_64_IRELATIVE => unsafe { reloc::R_X86_64_IRELATIVE => unsafe {
let f: unsafe extern "C" fn() -> u64 = transmute(b + a); let f: unsafe extern "C" fn() -> u64 = transmute(b + a);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment