summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h b/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h
index 29faa3950c5..68b696ee822 100644
--- a/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h
+++ b/lld/lib/ReaderWriter/PECOFF/LinkerGeneratedSymbolFile.h
@@ -219,6 +219,7 @@ private:
// Files are read lazily, so that it has no runtime overhead if
// there's no dllexported stdcall functions.
void readAllSymbols() const {
+ std::lock_guard<std::mutex> lock(_mutex);
for (File *file : _queue) {
if (auto *archive = dyn_cast<ArchiveLibraryFile>(file)) {
for (const std::string &sym : archive->getDefinedSymbols())
OpenPOWER on IntegriCloud