diff --git a/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index d86aee78947f..1e703281b2c6 100644 --- a/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/contrib/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1331,8 +1331,11 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, } // If there are no section headers we are done. - if (header.e_shnum == 0) + if (header.e_shnum == 0) { + if (arch_spec.GetTriple().getOS() == llvm::Triple::OSType::UnknownOS) + arch_spec.GetTriple().setOSName(HostInfo::GetOSString().data()); return 0; + } Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MODULES));