diff options
Diffstat (limited to 'lld/lib/Core/SymbolTable.cpp')
| -rw-r--r-- | lld/lib/Core/SymbolTable.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lld/lib/Core/SymbolTable.cpp b/lld/lib/Core/SymbolTable.cpp index 7fdecaf9dae..11c9e06a41e 100644 --- a/lld/lib/Core/SymbolTable.cpp +++ b/lld/lib/Core/SymbolTable.cpp @@ -208,16 +208,19 @@ void SymbolTable::addByName(const Atom &newAtom) { // fallthrough } case MCR_Error: - llvm::errs() << "Duplicate symbols: " - << existing->name() - << ":" - << existing->file().path() - << " and " - << newAtom.name() - << ":" - << newAtom.file().path() - << "\n"; - llvm::report_fatal_error("duplicate symbol error"); + if (!_context.getAllowDuplicates()) { + llvm::errs() << "Duplicate symbols: " + << existing->name() + << ":" + << existing->file().path() + << " and " + << newAtom.name() + << ":" + << newAtom.file().path() + << "\n"; + llvm::report_fatal_error("duplicate symbol error"); + } + useNew = false; break; } break; |

