summaryrefslogtreecommitdiffstats
path: root/lld/ELF/SyntheticSections.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-03-28 03:20:18 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-03-28 03:20:18 +0000
commit816127ea17edae0c7e2d5224d86e98181a1c602c (patch)
tree746023a93f6ba0cbbc26b5f59d0f953927c9a578 /lld/ELF/SyntheticSections.cpp
parent92eba0e14a2e33233e034c8b918b0144ee099baf (diff)
downloadbcm5719-llvm-816127ea17edae0c7e2d5224d86e98181a1c602c.tar.gz
bcm5719-llvm-816127ea17edae0c7e2d5224d86e98181a1c602c.zip
Initialize OffsetMap in a known location.
This is a small optimization and avoids the need to use call_once. llvm-svn: 328686
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
-rw-r--r--lld/ELF/SyntheticSections.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index fb5b3238bcc..5ff8ac0fc75 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -2573,8 +2573,11 @@ void elf::mergeSections() {
}
(*I)->addSection(MS);
}
- for (auto *MS : MergeSections)
+ for (auto *MS : MergeSections) {
MS->finalizeContents();
+ parallelForEach(MS->Sections,
+ [](MergeInputSection *Sec) { Sec->initOffsetMap(); });
+ }
std::vector<InputSectionBase *> &V = InputSections;
V.erase(std::remove(V.begin(), V.end(), nullptr), V.end());
OpenPOWER on IntegriCloud