summaryrefslogtreecommitdiffstats
path: root/lld/COFF/InputFiles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/COFF/InputFiles.cpp')
-rw-r--r--lld/COFF/InputFiles.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp
index 9a15827eaf7..d11c265104a 100644
--- a/lld/COFF/InputFiles.cpp
+++ b/lld/COFF/InputFiles.cpp
@@ -215,10 +215,8 @@ SymbolBody *ObjectFile::createSymbolBody(COFFSymbolRef Sym, const void *AuxP,
}
Chunk *C = SparseChunks[Sym.getSectionNumber()];
if (auto *SC = cast_or_null<SectionChunk>(C)) {
- if (!SC->isCOMDAT())
- return new (Alloc) DefinedRegular(COFFObj.get(), Sym, SC);
- auto *B = new (Alloc) DefinedCOMDAT(COFFObj.get(), Sym, SC);
- if (Sym.getValue() == 0 && !AuxP)
+ auto *B = new (Alloc) DefinedRegular(COFFObj.get(), Sym, SC);
+ if (SC->isCOMDAT() && Sym.getValue() == 0 && !AuxP)
SC->setSymbol(B);
return B;
}
OpenPOWER on IntegriCloud