1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-27 10:23:41 +03:00
This commit is contained in:
Rui Ueyama 2021-03-13 18:24:03 +09:00
parent a52dc879c2
commit 34b2e8029b
2 changed files with 7 additions and 5 deletions

View File

@ -576,8 +576,10 @@ void InputSection::scan_relocations() {
}
void InputSection::kill() {
is_alive = false;
for (FdeRecord &fde : fdes)
fde.is_alive = false;
file.sections[section_idx] = nullptr;
if (is_alive.exchange(false)) {
is_alive = false;
for (FdeRecord &fde : fdes)
fde.is_alive = false;
file.sections[section_idx] = nullptr;
}
}

2
mold.h
View File

@ -413,7 +413,7 @@ public:
bool is_ehframe = false;
// For COMDAT de-duplication and garbage collection
bool is_alive = true;
std::atomic_bool is_alive = true;
// For garbage collection
std::atomic_bool is_visited = false;