summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-elfabi
Commit message (Collapse)AuthorAgeFilesLines
* [Object/ELF.h] - Improve error reporting.George Rimar2019-07-051-1/+1
| | | | | | | | | | | | | | | | | The errors coming from ELF.h are usually not very useful because they are uninformative. This patch is a first step to improve the situation. I tested this patch with a run of check-llvm and found that few messages are untested. In this patch, I did not add more tests but marked all such cases with a "TODO" comment. For all tested messages I extended the error text to provide more details (see test cases changed). Differential revision: https://reviews.llvm.org/D64014 llvm-svn: 365183
* [yaml2obj][obj2yaml] - Add support for dumping/parsing .dynamic sections.George Rimar2019-02-0911-93/+144
| | | | | | | | | This teaches the tools to parse and dump the .dynamic section and its dynamic tags. Differential revision: https://reviews.llvm.org/D57691 llvm-svn: 353606
* [elfabi] Add support for reading dynamic symbols from binariesArmando Montanez2019-01-2413-18/+71
| | | | | | | | | | | | | | | | | 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
* [elfabi] Add support for reading DT_NEEDED from binariesArmando Montanez2019-01-182-0/+92
| | | | | | | | | This patch gives elfabi the ability to read DT_NEEDED entries from ELF binaries to populate NeededLibs in TextAPI's ELFStub. Differential Revision: https://reviews.llvm.org/D55852 llvm-svn: 351592
* [elfabi] Add support for reading DT_SONAME from binariesArmando Montanez2019-01-1611-17/+408
| | | | | | | | | | | | | | This change gives the llvm-elfabi tool the ability to read DT_SONAME from a binary ELF file into an ELFStub. Added: - DynamicEntries struct for storing dynamic entries that are relevant to elfabi. - terminatedSubstr() retrieves a null-terminated substring from a StringRef. - appendToError() appends a string to an error, allowing more specific error messages. Differential Revision: https://reviews.llvm.org/D55629 llvm-svn: 351361
* [elfabi] Add option to manually specify file read formatArmando Montanez2019-01-072-0/+29
| | | | | | Although llvm-elfabi will attempt to read input files without needing the format to be manually specified, doing so has the potential to introduce extraneous errors that can hinder debugging (since multiple readers may fail in attempts to read the file). This change allows the input file format to be manually specified to force elfabi to use a single reader. This makes it easier to test and debug errors specific to a given reader. llvm-svn: 350545
* [elfabi] Introduce tool for ELF TextAPIArmando Montanez2019-01-036-0/+81
Follow up for D53051 This patch introduces the tool associated with the ELF implementation of TextAPI (previously llvm-tapi, renamed for better distinction). This tool will house a number of features related to enalysis and manipulation of shared object's exposed interfaces. The first major feature for this tool is support for producing binary stubs that are useful for compile-time linking of shared objects. This patch introduces beginnings of support for reading binary ELF objects to work towards that goal. Added: - elfabi tool. - support for reading architecture from a binary ELF file into an ELFStub. - Support for writing .tbe files. Differential Revision: https://reviews.llvm.org/D55352 llvm-svn: 350341
OpenPOWER on IntegriCloud