diff --git a/include/swift/RemoteInspection/ReflectionContext.h b/include/swift/RemoteInspection/ReflectionContext.h index 61464a4ed3098..6291aec426598 100644 --- a/include/swift/RemoteInspection/ReflectionContext.h +++ b/include/swift/RemoteInspection/ReflectionContext.h @@ -635,6 +635,9 @@ class ReflectionContext return {nullptr, 0}; // Now for all the sections, find their name. for (const typename T::Section *Hdr : SecHdrVec) { + // Skip unused headers + if (Hdr->sh_type == llvm::ELF::SHT_NULL) + continue; uint32_t Offset = Hdr->sh_name; const char *Start = (const char *)StrTab + Offset; uint64_t StringSize = strnlen(Start, StrTabSize - Offset);