diff options
author | Martin Storsjo <martin@martin.st> | 2018-06-28 20:28:29 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-06-28 20:28:29 +0000 |
commit | 2a9bd7b75699c3507c69ccd55d1bcc810807c351 (patch) | |
tree | 6d0f8f8430b5af579e89b4c52d767af1bdd241aa /llvm/lib | |
parent | e52b75297336b81638484cd800394b480b0f67db (diff) | |
download | bcm5719-llvm-2a9bd7b75699c3507c69ccd55d1bcc810807c351.tar.gz bcm5719-llvm-2a9bd7b75699c3507c69ccd55d1bcc810807c351.zip |
[COFF] Fix constant sharing regression for MinGW
This fixes a regression since SVN r334523, where the object files
built targeting MinGW were rejected by GNU binutils tools. Prior to
that commit, we only put constants in comdat for MSVC configurations.
Differential Revision: https://reviews.llvm.org/D48567
llvm-svn: 335918
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index df8aecd7cf4..dc29397a343 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -1350,7 +1350,10 @@ static std::string scalarConstantToHexString(const Constant *C) { MCSection *TargetLoweringObjectFileCOFF::getSectionForConstant( const DataLayout &DL, SectionKind Kind, const Constant *C, unsigned &Align) const { - if (Kind.isMergeableConst() && C) { + if (Kind.isMergeableConst() && C && + getContext().getAsmInfo()->hasCOFFAssociativeComdats()) { + // GNU binutils doesn't support the kind of symbol with a null + // storage class that this generates. const unsigned Characteristics = COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ | COFF::IMAGE_SCN_LNK_COMDAT; |