Index: ELF/InputFiles.cpp =================================================================== --- ELF/InputFiles.cpp +++ ELF/InputFiles.cpp @@ -1080,7 +1080,8 @@ if (ESym.st_shndx == SHN_UNDEF) this->Symbols[I] = make(this, Name, Binding, StOther, Type); - else if (Sec == &InputSection::Discarded) + else if (Sec == &InputSection::Discarded && + !Sec->Name.startswith(".debug")) this->Symbols[I] = make(this, Name, Binding, StOther, Type, /*DiscardedSecIdx=*/SecIdx); else