1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

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
This commit is contained in:
Lang Hames 2013-11-08 22:14:49 +00:00
parent b485e0c406
commit 80f55165fb
3 changed files with 8 additions and 2 deletions

View File

@ -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; }

View File

@ -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.

View File

@ -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;
}