[PATCH] D56779: [ELF][X86_64] Fix corrupted LD -> LE optimization for TLS without PLT

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 16 11:20:39 PST 2019


ruiu added inline comments.


================
Comment at: ELF/Arch/X86_64.cpp:267-275
   // Convert
-  //   leaq bar at tlsld(%rip), %rdi
-  //   callq __tls_get_addr at PLT
+  //   leaq bar at tlsld(%rip), %rdi     # 48 8d 3d <Loc>
+  //   callq __tls_get_addr at PLT       # e8 <disp32>
   //   leaq bar at dtpoff(%rax), %rcx
   // to
   //   .word 0x6666
   //   .byte 0x66
----------------
Lekensteyn wrote:
> ruiu wrote:
> > Now this comment is at a wrong place? It looks like this comment explains the entire function, but I believe now this comment explains on the first "if" condition.
> The comment indeed describes the `if (NextOp == 0xe8) {` case below, except for the third instruction (related to dtpoff). How is that last instruction handled?
> 
> I kept the comment here because I thought that the `if (Type == R_X86_DTPOFF*) {` blocks took care of it. I can move it down, but this part I did not understand.
I mean why don't you move this comment inside `if (NextOp == 0xe8) {`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56779/new/

https://reviews.llvm.org/D56779





More information about the llvm-commits mailing list