diff --git a/contrib/llvm-project/lld/ELF/InputSection.h b/contrib/llvm-project/lld/ELF/InputSection.h index 112c6ab49a38..2acb9f1a8832 100644 --- a/contrib/llvm-project/lld/ELF/InputSection.h +++ b/contrib/llvm-project/lld/ELF/InputSection.h @@ -391,7 +391,8 @@ class InputSection : public InputSectionBase { }; inline bool isDebugSection(const InputSectionBase &sec) { - return sec.name.startswith(".debug") || sec.name.startswith(".zdebug"); + return (sec.flags & llvm::ELF::SHF_ALLOC) == 0 && + (sec.name.startswith(".debug") || sec.name.startswith(".zdebug")); } // The list of all input sections.