forked from OSchip/llvm-project
Don't silently ignore an error.
Found by inspection. llvm-svn: 249744
This commit is contained in:
parent
38a2a28ff7
commit
6390d16fd1
|
@ -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()) {
|
||||
|
|
Loading…
Reference in New Issue