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
Pipeline #9851 failed with stages
in 18 seconds
......@@ -398,10 +398,14 @@ impl Linker {
set_u64((b + a) as u64);
}
reloc::R_X86_64_TPOFF64 => {
let sym = symbol
.as_ref()
.expect("R_X86_64_TPOFF64 called without valid symbol");
set_u64((sym.value + a).wrapping_sub(t) as u64);
if rel.r_sym > 0 {
let sym = symbol
.as_ref()
.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 {
let f: unsafe extern "C" fn() -> u64 = transmute(b + a);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment