summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2013-11-08 22:14:49 +0000
committerLang Hames <lhames@gmail.com>2013-11-08 22:14:49 +0000
commit3078977d28f2d932afef2e65f4413e3ebca038ea (patch)
tree681e4c246304fa7d0a1a34332107393dff29bab1
parent68b1453ce02d61ee24900903d441cd0057c17c0f (diff)
downloadbcm5719-llvm-3078977d28f2d932afef2e65f4413e3ebca038ea.tar.gz
bcm5719-llvm-3078977d28f2d932afef2e65f4413e3ebca038ea.zip
Add a method to get the object-file appropriate stack map section.
Thanks to Eric Christopher for the tips on the appropriate way to do this. llvm-svn: 194282
-rw-r--r--llvm/include/llvm/MC/MCObjectFileInfo.h4
-rw-r--r--llvm/lib/CodeGen/StackMaps.cpp3
-rw-r--r--llvm/lib/MC/MCObjectFileInfo.cpp3
3 files changed, 8 insertions, 2 deletions
diff --git a/llvm/include/llvm/MC/MCObjectFileInfo.h b/llvm/include/llvm/MC/MCObjectFileInfo.h
index 5e5debe0548..c48dcb02162 100644
--- a/llvm/include/llvm/MC/MCObjectFileInfo.h
+++ b/llvm/include/llvm/MC/MCObjectFileInfo.h
@@ -142,6 +142,8 @@ protected:
/// ELF and MachO only.
const MCSection *TLSBSSSection; // Defaults to ".tbss".
+ /// StackMap section.
+ const MCSection *StackMapSection;
/// EHFrameSection - EH frame section. It is initialized on demand so it
/// can be overwritten (with uniquing).
@@ -285,6 +287,8 @@ public:
const MCSection *getTLSDataSection() const { return TLSDataSection; }
const MCSection *getTLSBSSSection() const { return TLSBSSSection; }
+ const MCSection *getStackMapSection() const { return StackMapSection; }
+
/// ELF specific sections.
///
const MCSection *getDataRelSection() const { return DataRelSection; }
diff --git a/llvm/lib/CodeGen/StackMaps.cpp b/llvm/lib/CodeGen/StackMaps.cpp
index b9b652d98d6..b6a900ab495 100644
--- a/llvm/lib/CodeGen/StackMaps.cpp
+++ b/llvm/lib/CodeGen/StackMaps.cpp
@@ -97,8 +97,7 @@ void StackMaps::serializeToStackMapSection() {
// Create the section.
const MCSection *StackMapSection =
- OutContext.getMachOSection("__LLVM_STACKMAPS", "__llvm_stackmaps", 0,
- SectionKind::getMetadata());
+ OutContext.getObjectFileInfo().getStackMapSection();
AP.OutStreamer.SwitchSection(StackMapSection);
// Emit a dummy symbol to force section inclusion.
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index 958648c656e..8ef4a0a6d7b 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -234,6 +234,9 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) {
Ctx->getMachOSection("__DWARF", "__debug_inlined",
MCSectionMachO::S_ATTR_DEBUG,
SectionKind::getMetadata());
+ StackMapSection =
+ Ctx->getMachOSection("__LLVM_STACKMAPS", "__llvm_stackmaps", 0,
+ SectionKind::getMetadata());
TLSExtraDataSection = TLSTLVSection;
}
OpenPOWER on IntegriCloud