[llvm-commits] [llvm] r79346 - in /llvm/trunk/lib: CodeGen/AsmPrinter/DwarfException.cpp Target/TargetLoweringObjectFile.cpp

Chris Lattner sabre at nondot.org
Tue Aug 18 09:56:17 PDT 2009


Author: lattner
Date: Tue Aug 18 11:56:17 2009
New Revision: 79346

URL: http://llvm.org/viewvc/llvm-project?rev=79346&view=rev
Log:
fix COFF targets (mingw/cygwin) to provide ehframe and LSDA sections

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
    llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=79346&r1=79345&r2=79346&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Tue Aug 18 11:56:17 2009
@@ -56,10 +56,7 @@
     TD->getPointerSize() : -TD->getPointerSize();
 
   // Begin eh frame section.
-  // FIXME: THIS IS A HORRIBLE HACK.  MingW isn't specifying an EHFrame section.
-  if (const MCSection *EHFrameSec = 
-      Asm->getObjFileLowering().getEHFrameSection())
-    Asm->SwitchToSection(EHFrameSec);
+  Asm->SwitchToSection(Asm->getObjFileLowering().getEHFrameSection());
 
   if (TAI->is_EHSymbolPrivate())
     O << TAI->getPrivateGlobalPrefix();
@@ -153,10 +150,7 @@
 
   const Function *TheFunc = EHFrameInfo.function;
   
-  // FIXME: THIS IS A HORRIBLE HACK.  MingW isn't specifying an EHFrame section.
-  if (const MCSection *EHFrameSec = 
-      Asm->getObjFileLowering().getEHFrameSection())
-    Asm->SwitchToSection(EHFrameSec);
+  Asm->SwitchToSection(Asm->getObjFileLowering().getEHFrameSection());
   
   // Externally visible entry into the functions eh frame info. If the
   // corresponding function is static, this should not be externally visible.

Modified: llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp?rev=79346&r1=79345&r2=79346&view=diff

==============================================================================
--- llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp Tue Aug 18 11:56:17 2009
@@ -963,6 +963,14 @@
   StaticDtorSection =
     getCOFFSection(".dtors", false, SectionKind::getDataRel());
   
+  // FIXME: We're emitting LSDA info into a readonly section on COFF, even
+  // though it contains relocatable pointers.  In PIC mode, this is probably a
+  // big runtime hit for C++ apps.  Either the contents of the LSDA need to be
+  // adjusted or this should be a data section.
+  LSDASection =
+    getCOFFSection(".gcc_except_table", false, SectionKind::getReadOnly());
+  EHFrameSection =
+    getCOFFSection(".eh_frame", false, SectionKind::getDataRel());
   
   // Debug info.
   // FIXME: Don't use 'directive' mode here.





More information about the llvm-commits mailing list