[cfe-commits] r142076 - /cfe/trunk/lib/Basic/Targets.cpp

Benjamin Kramer benny.kra at googlemail.com
Sat Oct 15 10:53:34 PDT 2011


Author: d0k
Date: Sat Oct 15 12:53:33 2011
New Revision: 142076

URL: http://llvm.org/viewvc/llvm-project?rev=142076&view=rev
Log:
Place static initializers on linux into the ".text.startup" section, so the linker can group them together for performance.

This only has an effect with fairly new binutils (2.21.51 or later). Other ELF targets probably want this as well, but on BSDs binutils is usually old so it doesn't matter.

Modified:
    cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=142076&r1=142075&r2=142076&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Sat Oct 15 12:53:33 2011
@@ -328,6 +328,10 @@
     this->UserLabelPrefix = "";
     this->WIntType = TargetInfo::UnsignedInt;
   }
+
+  virtual const char *getStaticInitSectionSpecifier() const {
+    return ".text.startup";
+  }
 };
 
 // NetBSD Target





More information about the cfe-commits mailing list