diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -332,6 +332,7 @@ } template void OutputSection::writeTo(uint8_t *buf) { + llvm::TimeTraceScope timeScope("Write sections", name); if (type == SHT_NOBITS) return; diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -2893,6 +2893,8 @@ // Write section contents to a mmap'ed file. template void Writer::writeSections() { + llvm::TimeTraceScope timeScope("Write sections"); + // In -r or --emit-relocs mode, write the relocation sections first as in // ELf_Rel targets we might find out that we need to modify the relocated // section while doing it.