[PATCH] D19904: XRay: Add entry and exit sleds

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 09:18:52 PDT 2016


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm


================
Comment at: lib/Target/X86/X86MCInstLower.cpp:1051
@@ +1050,3 @@
+  //   mov %r10, <function id, 32-bit>   // 6 bytes
+  //   call <relative offset, 32-bits>   // 5 bytes
+  //
----------------
Does XRay support multiple DSOs in the process? If so, the XRay runtime may be more than 2GB away from the code being patched, and this offset will overflow.

================
Comment at: lib/Target/X86/X86MCInstLower.cpp:1060-1061
@@ +1059,4 @@
+  // an operand (computed as an offset from the jmp instruction).
+  // FIXME: Find another less hacky way do force the relative jump.
+  OutStreamer->EmitBytes("\xeb\x09");
+  EmitNops(*OutStreamer, 9, Subtarget->is64Bit(), getSubtargetInfo());
----------------
I guess we can deal with this separately. IMO we should have a 'jmpb' instruction or something that forces a short jump or assembler error if the displacement is too large.


http://reviews.llvm.org/D19904





More information about the llvm-commits mailing list