[PATCH] D18039: [ELF] - Fixed handling R_X86_64_DTPOFF64 relocation relaxation

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 01:55:32 PST 2016


grimar added inline comments.

================
Comment at: ELF/Target.cpp:958-963
@@ -954,2 +957,8 @@
   }
+  case R_X86_64_TPOFF64: {
+    uint64_t Val = SA - Out<ELF64LE>::TlsPhdr->p_memsz;
+    checkInt<64>(Val, Type);
+    write64le(Loc, Val);
+    break;
+  }
   default:
----------------
ruiu wrote:
> Can't you reach this piece of code without going through relaxTls, can you?
> 
> If that's the case, please move this piece of code to relaxTls.
So in this patch - yes, but I found the way to reach R_X86_64_TPOFF64 using the next code:

```
.global a
.section .tbss,"awT", at nobits
  .align 4
a:
  .long 0

.text
.globl _start
_start:
 .quad	a at tpoff
```
But that is also not supported by gold:
gold: error: testthread.o: unexpected reloc 18 in object file
(bfd works fine here)

So it seems compilers don't do that and there is no need to support it.


Repository:
  rL LLVM

http://reviews.llvm.org/D18039





More information about the llvm-commits mailing list