hanchenye-llvm-project/llvm/tools/llvm-elfabi
Armando Montanez 8367b0750f [elfabi] Add support for reading dynamic symbols from binaries
This patch adds initial support for reading dynamic symbols from ELF binaries. Currently, STT_NOTYPE, STT_OBJECT, STT_FUNC, and STT_TLS are explicitly supported. Other symbol types are mapped to ELFSymbolType::Unknown to improve signal/noise ratio.

Symbols must meet two criteria to be read into in an ELFStub:

 - The symbol's binding must be STB_GLOBAL or STB_WEAK.
 - The symbol's visibility must be STV_DEFAULT or STV_PROTECTED.

This filters out symbols that aren't of interest during compile-time linking against a shared object.

This change uses DT_HASH and DT_GNU_HASH to determine the size of .dynsym. Using hash tables to determine the number of symbols in .dynsym allows llvm-elfabi to work on binaries without relying on section headers.

Differential Revision: https://reviews.llvm.org/D56031

llvm-svn: 352121
2019-01-24 22:39:21 +00:00
..
CMakeLists.txt
ELFObjHandler.cpp [elfabi] Add support for reading dynamic symbols from binaries 2019-01-24 22:39:21 +00:00
ELFObjHandler.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ErrorCollector.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ErrorCollector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-elfabi.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00