aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-09-05 00:14:12 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-09-05 00:14:12 +0000
commit7eb3b06ca2e0a896ea4611b64ceb2da5c5915361 (patch)
treed8e1f483d5790a082f892985aeefb02e47411104 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentad464dbf0b199c2cea242e6ba36314a1ea414902 (diff)
downloadllvm-7eb3b06ca2e0a896ea4611b64ceb2da5c5915361.zip
llvm-7eb3b06ca2e0a896ea4611b64ceb2da5c5915361.tar.gz
llvm-7eb3b06ca2e0a896ea4611b64ceb2da5c5915361.tar.bz2
Disable the fix for pr20793 because of a gnu ld bug.
llvm-svn: 217211
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 53c7b09..bf68501 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -31,6 +31,7 @@
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/ELF.h"
#include "llvm/Support/ErrorHandling.h"
@@ -41,6 +42,13 @@
using namespace llvm;
using namespace dwarf;
+// Disabled by default because it hits bug 17350 in GNU ld (gold is fine)
+static cl::opt<bool>
+ EnableStructorCOMDAT("enable-structor-comdat", cl::Hidden,
+ cl::desc("Use comdats to keep only one copy of a "
+ "constructor/destructor invocation"),
+ cl::init(false));
+
//===----------------------------------------------------------------------===//
// ELF
//===----------------------------------------------------------------------===//
@@ -363,6 +371,9 @@ static const MCSectionELF *getStaticStructorSection(MCContext &Ctx,
bool IsCtor,
unsigned Priority,
const MCSymbol *KeySym) {
+ if (!EnableStructorCOMDAT)
+ KeySym = nullptr;
+
std::string Name;
unsigned Type;
unsigned Flags = ELF::SHF_ALLOC | ELF::SHF_WRITE;