diff --git a/main.cc b/main.cc index 9c74b74b..205dc25b 100644 --- a/main.cc +++ b/main.cc @@ -141,10 +141,6 @@ static std::vector> split(const std::vector &input, int unit) { } static void handle_mergeable_strings(std::vector &files) { - static Counter counter("merged_strings"); - for (MergedSection *osec : MergedSection::instances) - counter.inc(osec->map.size()); - // Resolve mergeable string pieces tbb::parallel_for_each(files, [](ObjectFile *file) { for (InputSection *isec : file->mergeable_sections) { @@ -179,6 +175,10 @@ static void handle_mergeable_strings(std::vector &files) { osec->shdr.sh_size += isec->merged_size; } } + + static Counter counter("merged_strings"); + for (MergedSection *osec : MergedSection::instances) + counter.inc(osec->map.size()); } static void bin_sections(std::vector &files) { diff --git a/mold.h b/mold.h index 4ae4facf..5ab5961f 100644 --- a/mold.h +++ b/mold.h @@ -53,6 +53,7 @@ using llvm::object::ELFFile; class Symbol; class InputChunk; class InputSection; +class MergeableSection; class ObjectFile; class OutputChunk; class OutputSection;