From ec9de4677ac61f2164d7c80cae5da0008189efa3 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Fri, 1 Aug 2014 18:47:09 +0000 Subject: [PATCH] Add support for StackMap section for ELF/Linux systems 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 | 6 ++++++ lib/Target/X86/X86AsmPrinter.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp index df5787c7426..da707d860a6 100644 --- a/lib/MC/MCObjectFileInfo.cpp +++ b/lib/MC/MCObjectFileInfo.cpp @@ -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()); + } diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index 3c22e883375..fc0d408fd7d 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -736,6 +736,8 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) { } Stubs.clear(); } + + SM.serializeToStackMapSection(); } } -- 2.34.1