[lld] r242820 - Drop last use of getDynamicSymbolName.
Rafael Espindola
rafael.espindola at gmail.com
Tue Jul 21 11:15:32 PDT 2015
Author: rafael
Date: Tue Jul 21 13:15:32 2015
New Revision: 242820
URL: http://llvm.org/viewvc/llvm-project?rev=242820&view=rev
Log:
Drop last use of getDynamicSymbolName.
Modified:
lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp
Modified: lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp?rev=242820&r1=242819&r2=242820&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/DynamicFile.cpp Tue Jul 21 13:15:32 2015
@@ -54,23 +54,31 @@ template <class ELFT> bool DynamicFile<E
}
template <class ELFT> std::error_code DynamicFile<ELFT>::doParse() {
+ typedef llvm::object::ELFFile<ELFT> ELFO;
+
std::error_code ec;
- _objFile.reset(new llvm::object::ELFFile<ELFT>(_mb->getBuffer(), ec));
+ _objFile.reset(new ELFO(_mb->getBuffer(), ec));
if (ec)
return ec;
- llvm::object::ELFFile<ELFT> &obj = *_objFile;
+ ELFO &obj = *_objFile;
_soname = obj.getLoadName();
if (_soname.empty())
_soname = llvm::sys::path::filename(path());
+ const typename ELFO::Elf_Shdr *dynSymSec = obj.getDotDynSymSec();
+ ErrorOr<StringRef> strTableOrErr = obj.getStringTableForSymtab(*dynSymSec);
+ if (std::error_code ec = strTableOrErr.getError())
+ return ec;
+ StringRef stringTable = *strTableOrErr;
+
// Create a map from names to dynamic symbol table entries.
// TODO: This should use the object file's build in hash table instead if
// it exists.
for (auto i = obj.dynamic_symbol_begin(), e = obj.dynamic_symbol_end();
i != e; ++i) {
- auto name = obj.getDynamicSymbolName(i);
+ auto name = i->getName(stringTable);
if ((ec = name.getError()))
return ec;
More information about the llvm-commits
mailing list