Add support for StackMap section for ELF/Linux systems
authorPhilip Reames <listmail@philipreames.com>
Fri, 1 Aug 2014 18:47:09 +0000 (18:47 +0000)
committerPhilip Reames <listmail@philipreames.com>
Fri, 1 Aug 2014 18:47:09 +0000 (18:47 +0000)
This patch adds code to emits the StackMap section on ELF systems. This section is required to support llvm.experimental.stackmap and llvm.experimental.patchpoint intrinsics.

Reviewers: ributzka, echristo

Differential Revision: http://reviews.llvm.org/D4574

llvm-svn: 214538

llvm/lib/MC/MCObjectFileInfo.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp

index df5787c..da707d8 100644 (file)
@@ -583,6 +583,12 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
   DwarfAddrSection =
     Ctx->getELFSection(".debug_addr", ELF::SHT_PROGBITS, 0,
                        SectionKind::getMetadata());
+
+  StackMapSection =
+    Ctx->getELFSection(".llvm_stackmaps", ELF::SHT_PROGBITS,
+                       ELF::SHF_ALLOC,
+                       SectionKind::getMetadata());
+
 }
 
 
index 3c22e88..fc0d408 100644 (file)
@@ -736,6 +736,8 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
       }
       Stubs.clear();
     }
+
+    SM.serializeToStackMapSection();
   }
 }