summaryrefslogtreecommitdiff
path: root/lld
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-09-25 14:34:56 +0000
committerRui Ueyama <ruiu@google.com>2018-09-25 14:34:56 +0000
commitb4e49a2844eb90c857dd98575d43afc7ae075347 (patch)
treebd12d195e4c3b09cd7dad04e1ff8ceb0357686e5 /lld
parent5f3f16a72f5194a0bdaace769963af102d5ff885 (diff)
Parallelize .gdb_index string table writes.
When we are creating a large .gdb_index, this change makes a difference.
Diffstat (limited to 'lld')
-rw-r--r--lld/ELF/SyntheticSections.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp
index e4b1b0cc986..a12a50626a5 100644
--- a/lld/ELF/SyntheticSections.cpp
+++ b/lld/ELF/SyntheticSections.cpp
@@ -2576,8 +2576,9 @@ void GdbIndexSection::writeTo(uint8_t *Buf) {
// Write the string pool.
Hdr->ConstantPoolOff = Buf - Start;
- for (GdbSymbol &Sym : Symbols)
+ parallelForEach(Symbols, [&](GdbSymbol &Sym) {
memcpy(Buf + Sym.NameOff, Sym.Name.data(), Sym.Name.size());
+ });
// Write the CU vectors.
for (GdbSymbol &Sym : Symbols) {