diff options
author | David Chisnall <csdavec@swan.ac.uk> | 2012-04-10 11:44:33 +0000 |
---|---|---|
committer | David Chisnall <csdavec@swan.ac.uk> | 2012-04-10 11:44:33 +0000 |
commit | bbec87205db4d63b95423fccaca53f09d34cb11b (patch) | |
tree | 8ec39e69b8e32e9fed0073753fe208e45afe7ab6 /llvm/lib/MC/MCObjectFileInfo.cpp | |
parent | bc42d44112b950f28ac9b01f4ee3b566166d7d83 (diff) | |
download | llvm-bbec87205db4d63b95423fccaca53f09d34cb11b.zip llvm-bbec87205db4d63b95423fccaca53f09d34cb11b.tar.gz llvm-bbec87205db4d63b95423fccaca53f09d34cb11b.tar.bz2 |
Use the correct section types on Solaris for unwind data on both x86 and x86-64.
Patch by Dmitri Shubin!
llvm-svn: 154391
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectFileInfo.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp index 7dd06e7..b22ae33 100644 --- a/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/llvm/lib/MC/MCObjectFileInfo.cpp @@ -260,9 +260,14 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) { // Solaris requires different flags for .eh_frame to seemingly every other // platform. + EHSectionType = ELF::SHT_PROGBITS; EHSectionFlags = ELF::SHF_ALLOC; - if (T.getOS() == Triple::Solaris) - EHSectionFlags |= ELF::SHF_WRITE; + if (T.getOS() == Triple::Solaris) { + if (T.getArch() == Triple::x86_64) + EHSectionType = ELF::SHT_X86_64_UNWIND; + else + EHSectionFlags |= ELF::SHF_WRITE; + } // ELF @@ -575,7 +580,7 @@ void MCObjectFileInfo::InitEHFrameSection() { SectionKind::getReadOnly()); else if (Env == IsELF) EHFrameSection = - Ctx->getELFSection(".eh_frame", ELF::SHT_PROGBITS, + Ctx->getELFSection(".eh_frame", EHSectionType, EHSectionFlags, SectionKind::getDataRel()); else |