[Lldb-commits] [lldb] [LLDB] Warn about truncated DWARF section names on Windows (PR #145175)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 23 02:51:05 PDT 2025


================
@@ -1071,6 +1077,15 @@ void ObjectFilePECOFF::CreateSections(SectionList &unified_section_list) {
       m_sections_up->AddSection(section_sp);
       unified_section_list.AddSection(section_sp);
     }
+
+    if (!truncated_dwarf_sections.empty())
+      module_sp->ReportWarning(
+          "contains {} truncated DWARF sections ({}).\n"
+          "Executable images on Windows can't include the required names "
+          "when linking with the default link.exe. A third party linker like "
+          "lld-link is required (compile with -fuse-ld=lld-link on Clang).",
----------------
DavidSpickett wrote:

I understand this as written but it would benefit from rephrasing to be clearer without extra context. Also the names are truncated not the section data, which this implies.

How about:
```
contains {} DWARF sections with truncated names ({}).\n
Windows executable (PECOFF) images produced by link.exe cannot include the required section names due to a restriction on section name length. A third party linker like lld-link is required (compile with -fuse-ld=lld-link when using Clang)."
```

https://github.com/llvm/llvm-project/pull/145175


More information about the lldb-commits mailing list