summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Chisnall <csdavec@swan.ac.uk>2012-02-17 17:31:15 +0000
committerDavid Chisnall <csdavec@swan.ac.uk>2012-02-17 17:31:15 +0000
commit07f8d3e4e9673285f162720ab46b772ae070e32a (patch)
treefaba41a563793bff72b14e0823597acae7ce46c7
parent85dd309e855ec1edefff5dcc2e7c957e23f48f2f (diff)
downloadbcm5719-llvm-07f8d3e4e9673285f162720ab46b772ae070e32a.tar.gz
bcm5719-llvm-07f8d3e4e9673285f162720ab46b772ae070e32a.zip
Generate the correct EH frame section types on Solaris, this time without breaking other platforms...
llvm-svn: 150819
-rw-r--r--llvm/include/llvm/MC/MCObjectFileInfo.h2
-rw-r--r--llvm/lib/MC/MCObjectFileInfo.cpp9
2 files changed, 10 insertions, 1 deletions
diff --git a/llvm/include/llvm/MC/MCObjectFileInfo.h b/llvm/include/llvm/MC/MCObjectFileInfo.h
index e58e7d68f7f..5d5801f33da 100644
--- a/llvm/include/llvm/MC/MCObjectFileInfo.h
+++ b/llvm/include/llvm/MC/MCObjectFileInfo.h
@@ -47,6 +47,8 @@ protected:
unsigned FDEEncoding;
unsigned FDECFIEncoding;
unsigned TTypeEncoding;
+ // Section flags for eh_frame
+ unsigned EHSectionFlags;
/// TextSection - Section directive for standard text.
///
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index 1b8653531e8..1a27df5dc0c 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 =
OpenPOWER on IntegriCloud