Index: ELF/InputFiles.cpp =================================================================== --- ELF/InputFiles.cpp +++ ELF/InputFiles.cpp @@ -802,7 +802,7 @@ fatal(toString(this) + ": invalid symbol name offset"); StringRefZ Name = this->StringTable.data() + Sym->st_name; - if (Sym->st_shndx == SHN_UNDEF) + if (Sym->st_shndx == SHN_UNDEF || Sec == &InputSection::Discarded) return make(this, Name, Binding, StOther, Type); return make(this, Name, Binding, StOther, Type, Value, Size, Sec);