[llvm-commits] [llvm] r123585 - /llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp

Rafael Espindola rafael.espindola at gmail.com
Sun Jan 16 09:19:34 PST 2011


Author: rafael
Date: Sun Jan 16 11:19:34 2011
New Revision: 123585

URL: http://llvm.org/viewvc/llvm-project?rev=123585&view=rev
Log:
Only put unnamed_addr constants in mergeable sections. Fixes PR8297.

Modified:
    llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp

Modified: llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp?rev=123585&r1=123584&r2=123585&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp Sun Jan 16 11:19:34 2011
@@ -162,7 +162,7 @@
 
   // If the global is marked constant, we can put it into a mergable section,
   // a mergable string section, or general .data if it contains relocations.
-  if (GVar->isConstant()) {
+  if (GVar->isConstant() && GVar->hasUnnamedAddr()) {
     // If the initializer for the global contains something that requires a
     // relocation, then we may have to drop this into a wriable data section
     // even though it is marked const.





More information about the llvm-commits mailing list