diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp
index 681beec..f033e35 100644
--- a/lib/Target/TargetLoweringObjectFile.cpp
+++ b/lib/Target/TargetLoweringObjectFile.cpp
@@ -25,12 +25,18 @@
 #include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetOptions.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Dwarf.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/ADT/SmallString.h"
 using namespace llvm;
 
+static cl::opt<bool>
+MergeAll("codegen-merge-all",
+         cl::desc("Merge non unnamed_adrr constants too"),
+         cl::init(false), cl::Hidden);
+
 //===----------------------------------------------------------------------===//
 //                              Generic Code
 //===----------------------------------------------------------------------===//
@@ -172,9 +178,9 @@ SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalValue *GV,
       // If the global is required to have a unique address, it can't be put
       // into a mergable section: just drop it into the general read-only
       // section instead.
-      if (!GVar->hasUnnamedAddr())
+      if (!GVar->hasUnnamedAddr() && !MergeAll)
         return SectionKind::getReadOnly();
-        
+
       // If initializer is a null-terminated string, put it in a "cstring"
       // section of the right width.
       if (const ArrayType *ATy = dyn_cast<ArrayType>(C->getType())) {
diff --git a/lib/Transforms/IPO/ConstantMerge.cpp b/lib/Transforms/IPO/ConstantMerge.cpp
index a21efce..2e5e278 100644
--- a/lib/Transforms/IPO/ConstantMerge.cpp
+++ b/lib/Transforms/IPO/ConstantMerge.cpp
@@ -18,6 +18,7 @@
 //===----------------------------------------------------------------------===//
 
 #define DEBUG_TYPE "constmerge"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
@@ -30,6 +31,11 @@ using namespace llvm;
 
 STATISTIC(NumMerged, "Number of global constants merged");
 
+static cl::opt<bool>
+MergeAll("constmerge-merge-all",
+         cl::desc("Merge non unnamed_adrr constants too"),
+         cl::init(false), cl::Hidden);
+
 namespace {
   struct ConstantMerge : public ModulePass {
     static char ID; // Pass identification, replacement for typeid
@@ -157,7 +163,7 @@ bool ConstantMerge::runOnModule(Module &M) {
       if (!Slot || Slot == GV)
         continue;
 
-      if (!Slot->hasUnnamedAddr() && !GV->hasUnnamedAddr())
+      if (!MergeAll && !Slot->hasUnnamedAddr() && !GV->hasUnnamedAddr())
         continue;
 
       if (!GV->hasUnnamedAddr())
