mirror of
https://github.com/rui314/mold.git
synced 2024-10-04 08:37:28 +03:00
Refactor
This commit is contained in:
parent
2eeb7b411e
commit
cf38f81c39
@ -1551,7 +1551,6 @@ private:
|
||||
|
||||
template <> u64 get_eflags(Context<ARM32> &ctx);
|
||||
void create_arm_exidx_section(Context<ARM32> &ctx);
|
||||
void fixup_arm_exidx_section(Context<ARM32> &ctx);
|
||||
|
||||
//
|
||||
// arch-riscv.cc
|
||||
|
@ -1347,11 +1347,9 @@ void compute_section_sizes(Context<E> &ctx) {
|
||||
Timer t(ctx, "compute_section_sizes");
|
||||
|
||||
if constexpr (needs_thunk<E>) {
|
||||
// Chunk<E>::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<E> *chunk : ctx.chunks)
|
||||
if (chunk->shdr.sh_flags & SHF_EXECINSTR)
|
||||
chunk->compute_section_size(ctx);
|
||||
|
@ -167,10 +167,6 @@ static void scan_rels(Context<E> &ctx, InputSection<E> &isec,
|
||||
|
||||
template <>
|
||||
void OutputSection<E>::create_range_extension_thunks(Context<E> &ctx) {
|
||||
// This function is not thread-safe because it mutates symbols' members
|
||||
static std::mutex mu;
|
||||
std::scoped_lock lock(mu);
|
||||
|
||||
std::span<InputSection<E> *> m = members;
|
||||
if (m.empty())
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user