[llvm-commits] [llvm] r43676 - in /llvm/trunk/lib/Target/PowerPC: PPCAsmPrinter.cpp PPCTargetAsmInfo.cpp

Nick Lewycky nicholas at mxc.ca
Sun Nov 4 09:32:10 PST 2007


Author: nicholas
Date: Sun Nov  4 11:32:10 2007
New Revision: 43676

URL: http://llvm.org/viewvc/llvm-project?rev=43676&view=rev
Log:
Fix crash before main on ppc/linux with static constructors. PR1771

Modified:
    llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
    llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=43676&r1=43675&r2=43676&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Sun Nov  4 11:32:10 2007
@@ -668,6 +668,8 @@
       if (I->hasExternalLinkage()) {
         O << "\t.global " << name << '\n';
         O << "\t.type " << name << ", @object\n";
+        if (TAI->getBSSSection())
+          SwitchToDataSection(TAI->getBSSSection(), I);
         O << name << ":\n";
         O << "\t.zero " << Size << "\n";
       } else if (I->hasInternalLinkage()) {

Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=43676&r1=43675&r2=43676&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Sun Nov  4 11:32:10 2007
@@ -60,6 +60,7 @@
   HiddenDirective = "\t.private_extern\t";
   SupportsExceptionHandling = false;
   NeedsIndirectEncoding = true;
+  BSSSection = 0;
 
   DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
   DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
@@ -94,6 +95,7 @@
   StaticDtorsSection = ".section\t.dtors,\"aw\", at progbits";
   UsedDirective = "\t# .no_dead_strip\t";
   WeakRefDirective = "\t.weak\t";
+  BSSSection = "\t.section\t\".sbss\",\"aw\", at nobits";
 
   DwarfAbbrevSection =  "\t.section\t.debug_abbrev,\"\", at progbits";
   DwarfInfoSection =    "\t.section\t.debug_info,\"\", at progbits";





More information about the llvm-commits mailing list