Index: lld/COFF/Chunks.cpp =================================================================== --- lld/COFF/Chunks.cpp +++ lld/COFF/Chunks.cpp @@ -271,6 +271,10 @@ return; // Copy section contents from source object file to output file. ArrayRef A = getContents(); + if (A.empty()) { + assert(Relocs.empty() && "Empty section should not have relocations"); + return; + } memcpy(Buf + OutputSectionOff, A.data(), A.size()); // Apply relocations.