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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214538 91177308-0d34-0410-b5e6-96231b3b80d8

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

index df5787c7426e9e9829c375c3465248d74ae3002d..da707d860a6a0ef532c1256736f6414828e3a7fa 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 3c22e8833756959c2370ac5aef0222fb3cf8e80d..fc0d408fd7d10fd1997d1f1837f7e08da26d0e94 100644 (file)
@@ -736,6 +736,8 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
       }
       Stubs.clear();
     }
+
+    SM.serializeToStackMapSection();
   }
 }