Don't silently ignore an error.

Found by inspection.

llvm-svn: 249744
This commit is contained in:
Rafael Espindola 2015-10-08 20:43:19 +00:00
parent 38a2a28ff7
commit 6390d16fd1
1 changed files with 5 additions and 3 deletions

View File

@ -322,9 +322,11 @@ template <class ELFT> void Writer<ELFT>::createSections() {
if (!Config->DiscardAll) {
Elf_Sym_Range Syms = File.getLocalSymbols();
for (const Elf_Sym &Sym : Syms) {
ErrorOr<StringRef> SymName = Sym.getName(File.getStringTable());
if (SymName && shouldKeepInSymtab<ELFT>(*SymName, Sym))
Out<ELFT>::SymTab->addSymbol(*SymName, true);
ErrorOr<StringRef> SymNameOrErr = Sym.getName(File.getStringTable());
error(SymNameOrErr);
StringRef SymName = *SymNameOrErr;
if (shouldKeepInSymtab<ELFT>(SymName, Sym))
Out<ELFT>::SymTab->addSymbol(SymName, true);
}
}
for (InputSection<ELFT> *C : File.getSections()) {