[llvm-commits] [llvm] r154391 - in /llvm/trunk: include/llvm/MC/MCObjectFileInfo.h lib/MC/MCObjectFileInfo.cpp

David Chisnall csdavec at swan.ac.uk
Tue Apr 10 04:44:33 PDT 2012


Author: theraven
Date: Tue Apr 10 06:44:33 2012
New Revision: 154391

URL: http://llvm.org/viewvc/llvm-project?rev=154391&view=rev
Log:
Use the correct section types on Solaris for unwind data on both x86 and x86-64.

Patch by Dmitri Shubin!


Modified:
    llvm/trunk/include/llvm/MC/MCObjectFileInfo.h
    llvm/trunk/lib/MC/MCObjectFileInfo.cpp

Modified: llvm/trunk/include/llvm/MC/MCObjectFileInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCObjectFileInfo.h?rev=154391&r1=154390&r2=154391&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCObjectFileInfo.h (original)
+++ llvm/trunk/include/llvm/MC/MCObjectFileInfo.h Tue Apr 10 06:44:33 2012
@@ -47,6 +47,7 @@
   unsigned FDECFIEncoding;
   unsigned TTypeEncoding;
   // Section flags for eh_frame
+  unsigned EHSectionType;
   unsigned EHSectionFlags;
 
   /// TextSection - Section directive for standard text.

Modified: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFileInfo.cpp?rev=154391&r1=154390&r2=154391&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Tue Apr 10 06:44:33 2012
@@ -260,9 +260,14 @@
 
   // 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 @@
                            SectionKind::getReadOnly());
   else if (Env == IsELF)
     EHFrameSection =
-      Ctx->getELFSection(".eh_frame", ELF::SHT_PROGBITS,
+      Ctx->getELFSection(".eh_frame", EHSectionType,
                          EHSectionFlags,
                          SectionKind::getDataRel());
   else





More information about the llvm-commits mailing list