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

David Chisnall csdavec at swan.ac.uk
Fri Feb 17 09:31:15 PST 2012


Author: theraven
Date: Fri Feb 17 11:31:15 2012
New Revision: 150819

URL: http://llvm.org/viewvc/llvm-project?rev=150819&view=rev
Log:
Generate the correct EH frame section types on Solaris, this time without breaking other platforms...


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=150819&r1=150818&r2=150819&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCObjectFileInfo.h (original)
+++ llvm/trunk/include/llvm/MC/MCObjectFileInfo.h Fri Feb 17 11:31:15 2012
@@ -47,6 +47,8 @@
   unsigned FDEEncoding;
   unsigned FDECFIEncoding;
   unsigned TTypeEncoding;
+  // Section flags for eh_frame
+  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=150819&r1=150818&r2=150819&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Fri Feb 17 11:31:15 2012
@@ -258,6 +258,13 @@
     }
   }
 
+  // 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 @@
   else if (Env == IsELF)
     EHFrameSection =
       Ctx->getELFSection(".eh_frame", ELF::SHT_PROGBITS,
-                         ELF::SHF_ALLOC,
+                         EHSectionFlags,
                          SectionKind::getDataRel());
   else
     EHFrameSection =





More information about the llvm-commits mailing list