[PATCH] D19908: [X86] Support the "ms-hotpatch" attribute.

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 08:45:09 PDT 2016


rnk requested changes to this revision.
rnk added a comment.
This revision now requires changes to proceed.

This should use Sanjoy's "patchable-function" attribute:
http://reviews.llvm.org/D19046


================
Comment at: lib/Target/X86/X86AsmPrinter.cpp:76
@@ -75,1 +75,3 @@
 
+void X86AsmPrinter::EmitFunctionEntryLabel() {
+  // If a hotpatch function, we need to ensure 64 (32-bit) or 128 (64-bit)
----------------
You should consider overriding EmitConstantPool instead, so the fill directive comes before the alignment directive:
  .text
  .fill 5, 1, 0xcc
  .align 2
  .global foo
  foo:
    movl %edi, %edi
    retq

Are the hotpatching tools that we care about checking for 0xcc bytes, or will they overwrite alignment nops?


http://reviews.llvm.org/D19908





More information about the llvm-commits mailing list