Commit 43fbaf99 authored by Ahmed Abd El Mawgood's avatar Ahmed Abd El Mawgood

Fix a bug in thread local reloations

There was a bug (also uncovered via binutils) where R_X86_64_DTPOFF64 is
set uncorrectly. This program is the minimal reproducer of the seg fault

  #include <errno.h>
  int main() {
        int oerrno = errno;
  }

But it works after the bug fix.
parent a39447e6
......@@ -666,7 +666,7 @@ impl Linker {
set_u64(tm as u64);
}
reloc::R_X86_64_DTPOFF64 => {
set_u64((s + a) as u64);
set_u64(rel.r_offset as u64);
}
reloc::R_X86_64_GLOB_DAT | reloc::R_X86_64_JUMP_SLOT => {
set_u64(s as u64);
......
Markdown is supported
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