From 07f8d3e4e9673285f162720ab46b772ae070e32a Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Fri, 17 Feb 2012 17:31:15 +0000 Subject: Generate the correct EH frame section types on Solaris, this time without breaking other platforms... llvm-svn: 150819 --- llvm/lib/MC/MCObjectFileInfo.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp') diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index 1b86535..1a27df5 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -258,6 +258,13 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) { } } + // Solaris requires different flags for .eh_frame to seemingly every other + // platform. + EHSectionFlags = ELF::SHF_ALLOC; + if (T.getOS() == Triple::Solaris) + EHSectionFlags |= ELF::SHF_WRITE; + + // ELF BSSSection = Ctx->getELFSection(".bss", ELF::SHT_NOBITS, @@ -559,7 +566,7 @@ void MCObjectFileInfo::InitEHFrameSection() { else if (Env == IsELF) EHFrameSection = Ctx->getELFSection(".eh_frame", ELF::SHT_PROGBITS, - ELF::SHF_ALLOC, + EHSectionFlags, SectionKind::getDataRel()); else EHFrameSection = -- cgit v1.1