[lld] r240951 - Update for llvm api change.
Rafael Espindola
rafael.espindola at gmail.com
Mon Jun 29 07:39:30 PDT 2015
Author: rafael
Date: Mon Jun 29 09:39:30 2015
New Revision: 240951
URL: http://llvm.org/viewvc/llvm-project?rev=240951&view=rev
Log:
Update for llvm api change.
Modified:
lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp
Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp?rev=240951&r1=240950&r2=240951&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.cpp Mon Jun 29 09:39:30 2015
@@ -486,7 +486,11 @@ std::error_code ELFFile<ELFT>::handleSec
}
const Elf_Sym *symbol = _objFile->getSymbol(section->sh_info);
const Elf_Shdr *symtab = _objFile->getSection(section->sh_link);
- const Elf_Shdr *strtab = _objFile->getSection(symtab->sh_link);
+ const Elf_Shdr *strtab_sec = _objFile->getSection(symtab->sh_link);
+ ErrorOr<StringRef> strtab_or_err = _objFile->getStringTable(strtab_sec);
+ if (std::error_code ec = strtab_or_err.getError())
+ return ec;
+ StringRef strtab = *strtab_or_err;
ErrorOr<StringRef> symbolName = _objFile->getSymbolName(strtab, symbol);
if (std::error_code ec = symbolName.getError())
return ec;
More information about the llvm-commits
mailing list