[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:26:22 PST 2019


ruiu added inline comments.


================
Comment at: ELF/Arch/X86_64.cpp:290-291
   };
-  memcpy(Loc - 3, Inst, sizeof(Inst));
+  const uint8_t NextOp = Loc[4];
+  if (NextOp == 0xe8) {
+    memcpy(Loc - 3, Inst, sizeof(Inst));
----------------
When we are rewriting instructions, we don't have to understand the instruction encoding or anything but can just follow the rule. So I'd remove `NextOp` varaible and use `Loc[4]` instead. Likewise, remove `NextModRm` and just use `Loc[5]`.


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

https://reviews.llvm.org/D56779





More information about the llvm-commits mailing list