diff --git a/src/mold.h b/src/mold.h index ece8069d..4149f045 100644 --- a/src/mold.h +++ b/src/mold.h @@ -1551,7 +1551,6 @@ private: template <> u64 get_eflags(Context &ctx); void create_arm_exidx_section(Context &ctx); -void fixup_arm_exidx_section(Context &ctx); // // arch-riscv.cc diff --git a/src/passes.cc b/src/passes.cc index 5765568d..24b2c359 100644 --- a/src/passes.cc +++ b/src/passes.cc @@ -1347,11 +1347,9 @@ void compute_section_sizes(Context &ctx) { Timer t(ctx, "compute_section_sizes"); if constexpr (needs_thunk) { - // Chunk::compute_section_size obtains a global lock to create - // range extension thunks. I don't know why, but using parallel_for - // loop both inside and outside of the lock may cause a deadlock. It - // might be a bug in TBB. For now, I'll avoid using parallel_for_each - // here. + // We cannot use parallel-for for compute_section_size() which may + // call create_range_extension_thunks() because that function is + // not thread-safe. for (Chunk *chunk : ctx.chunks) if (chunk->shdr.sh_flags & SHF_EXECINSTR) chunk->compute_section_size(ctx); diff --git a/src/thunks.cc b/src/thunks.cc index cafbe8b1..c5a99fbc 100644 --- a/src/thunks.cc +++ b/src/thunks.cc @@ -167,10 +167,6 @@ static void scan_rels(Context &ctx, InputSection &isec, template <> void OutputSection::create_range_extension_thunks(Context &ctx) { - // This function is not thread-safe because it mutates symbols' members - static std::mutex mu; - std::scoped_lock lock(mu); - std::span *> m = members; if (m.empty()) return;