diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp --- a/lld/COFF/Writer.cpp +++ b/lld/COFF/Writer.cpp @@ -332,7 +332,7 @@ *hdr = header; if (stringTableOff) { // If name is too long, write offset into the string table as a name. - sprintf(hdr->Name, "/%d", stringTableOff); + encodeSectionName(hdr->Name, stringTableOff); } else { assert(!config->debug || name.size() <= COFF::NameSize || (hdr->Characteristics & IMAGE_SCN_MEM_DISCARDABLE) == 0);