summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/ELFDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-readobj] Don't cast qualifiers away. Now gcc is happy again.Davide Italiano2015-10-231-7/+8
| | | | | | Reported by: mikael.holmen at ericsson.com llvm-svn: 251117
* [llvm-readobj] Teach ELFDumper about symbol versioning.Davide Italiano2015-10-161-6/+97
| | | | | | Differential Revision: http://reviews.llvm.org/D13824 llvm-svn: 250575
* [llvm-readobj/ELF] Dump DT_VERDEF/DT_VERDEFNUM correctly.Davide Italiano2015-10-151-0/+4
| | | | llvm-svn: 250464
* [llvm-readobj/ELF] Print GNU Hash sectionIgor Kudrin2015-10-141-0/+24
| | | | | | | | Add a new command line switch, -gnu-hash-table, to print the content of that section. Differential Revision: http://reviews.llvm.org/D13696 llvm-svn: 250291
* Fix printing of 64 bit values and make test more strict.Rafael Espindola2015-10-011-5/+4
| | | | llvm-svn: 249043
* Avoid SEGFAULT if a requested symbol section is absent.Rafael Espindola2015-09-211-0/+2
| | | | | | Patch by Igor Kudrin! llvm-svn: 248194
* Pass a symbol table to getRelocationSymbol instead of returning one.Rafael Espindola2015-09-021-18/+18
| | | | | | | This removes a report_fatal_error from library and avoids checking a section property for every section entry. llvm-svn: 246656
* [llvm-readobj/ELF] Factor out common code.Davide Italiano2015-08-231-12/+11
| | | | llvm-svn: 245813
* Don't iterate over all sections in the ELFFile constructor.Rafael Espindola2015-08-101-12/+31
| | | | | | | With this we finally have an ELFFile that is O(1) to construct. This is helpful for programs like lld which have to do their own section walk. llvm-svn: 244510
* Delete getDotSymtabSec.Rafael Espindola2015-08-101-4/+11
| | | | | | Another step in avoiding iterating over all sections in the ELFFile constructor. llvm-svn: 244496
* Don't look for a SHT_DYNSYM in the ELFFile's constructor.Rafael Espindola2015-08-071-2/+9
| | | | | | Yet another step in not having it scan every section. llvm-svn: 244353
* Remove the symbol iteration functions that don't take a symbol table.Rafael Espindola2015-08-071-2/+2
| | | | | | Another step in making ELFFile's constructor not iterate over all sections. llvm-svn: 244351
* Add dynamic_table iterators back to ELF.h.Rafael Espindola2015-08-071-22/+15
| | | | | | | | | In tree they are only used by llvm-readobj, but it is also used by https://github.com/mono/CppSharp. While at it, add some missing error checking. llvm-svn: 244320
* ELF: Add AMDGPU specific defintionsTom Stellard2015-08-071-2/+24
| | | | | | | | | | Reviewers: rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11458 llvm-svn: 244303
* [llvm-readobj] Convert to range-loops.Davide Italiano2015-08-071-2/+2
| | | | llvm-svn: 244300
* Move to llvm-readobj code that is only used there.Rafael Espindola2015-08-061-20/+213
| | | | | | | | | | lld might end up using a small part of this, but it will be in a much refactored form. For now this unblocks avoiding the full section scan in the ELFFile constructor. This also has a (very small) error handling improvement. llvm-svn: 244282
* [Mips] Support DT_MIPS_RLD_MAP_REL dynamic section tag in the llvm-readobjSimon Atanasyan2015-08-011-0/+2
| | | | llvm-svn: 243833
* Support printing relocations in files with no section table.Rafael Espindola2015-07-231-4/+9
| | | | llvm-svn: 242998
* Use typdef to simplify the code. NFC.Rafael Espindola2015-07-231-40/+41
| | | | llvm-svn: 242995
* Delete ELFEntityIterator. NFC.Rafael Espindola2015-07-221-31/+34
| | | | llvm-svn: 242901
* Don't iterate over the program headers in the constructor of ELFFile.Rafael Espindola2015-07-211-28/+162
| | | | | | | | | Not every program needs this information. In particular, it is necessary and sufficient for a static linker to scan the section table. llvm-svn: 242833
* Make printValue a member function.Rafael Espindola2015-07-211-6/+7
| | | | | | We were already passing 3 values it can get from ELFDumper. llvm-svn: 242829
* Remove always null argument.Rafael Espindola2015-07-211-2/+1
| | | | llvm-svn: 242828
* Replace the last uses of ELF::getSymbolName in llvm-readobj.Rafael Espindola2015-07-211-1/+2
| | | | llvm-svn: 242798
* Use helper function. NFC.Rafael Espindola2015-07-211-3/+1
| | | | llvm-svn: 242795
* llvm-readobj: use the associated string table to print symbols. NFI.Rafael Espindola2015-07-211-16/+44
| | | | | | | This just removes some cases that require ELFFile to eagerly parse the ELF file. llvm-svn: 242794
* Simplify printing the soname. NFC.Rafael Espindola2015-07-211-0/+5
| | | | llvm-svn: 242786
* Simplify now that we can iterate backwards. NFC.Rafael Espindola2015-07-201-3/+16
| | | | llvm-svn: 242715
* Remove Elf_Rela_Iter and Elf_Rel_Iter.Rafael Espindola2015-07-201-27/+19
| | | | | | Use just the pointers and check for invalid relocation sections. llvm-svn: 242700
* Simplify iterating over program headers and detect corrupt ones.Rafael Espindola2015-07-201-13/+11
| | | | | | We now use a simple pointer and have range loops. llvm-svn: 242669
* llvm-readobj: Handle invalid references to the string table.Rafael Espindola2015-07-201-4/+12
| | | | llvm-svn: 242658
* llvm-readobj: call exit(1) on error.Rafael Espindola2015-07-201-12/+10
| | | | | | | | | llvm-readobj exists for testing llvm. We can safely stop the program the first time we know the input in corrupted. This is in preparation for making it handle a few more broken files. llvm-svn: 242656
* [Object][ELF] Support dumping hash-tables from files with no section table.Michael J. Spencer2015-07-091-0/+13
| | | | | | This time without breaking the bots. llvm-svn: 241869
* [llvm-readobj] Print MIPS PLT tableSimon Atanasyan2015-07-091-73/+164
| | | | | | Now the -mips-plt-got prints both MIPS GOT and PLT tables. llvm-svn: 241836
* Temporarily reverting 241765, 241768, and 241772 to unbreak the build bots.Adrian Prantl2015-07-091-13/+0
| | | | llvm-svn: 241781
* [Object][ELF] Support dumping hash-tables from files with no section table.Michael J. Spencer2015-07-091-0/+13
| | | | llvm-svn: 241765
* Return ErrorOr from getSection.Rafael Espindola2015-07-011-11/+19
| | | | | | | | | | | | | | This also improves the logic of what is an error: * getSection(uint_32): only return an error if the index is out of bounds. The index 0 corresponds to a perfectly valid entry. * getSection(Elf_Sym): Returns null for symbols that normally don't have sections and error for out of bound indexes. In many places this just moves the report_fatal_error up the stack, but those can then be fixed in smaller patches. llvm-svn: 241156
* Use range loops. NFC.Rafael Espindola2015-06-301-30/+24
| | | | llvm-svn: 241105
* Fix the name of the iterator functions to match the coding standards.Rafael Espindola2015-06-301-18/+18
| | | | llvm-svn: 241074
* Convert obj->getSymbolName to sym->getName.Rafael Espindola2015-06-291-2/+1
| | | | | | I doesn't depend on the object anymore. llvm-svn: 240996
* Factor out the checking of string tables.Rafael Espindola2015-06-291-2/+5
| | | | | | | | | | This moves the error checking for string tables to getStringTable which returns an ErrorOr<StringRef>. This improves error checking, makes it uniform across all string tables and makes it possible to check them once instead of once per name. llvm-svn: 240950
* Remove Elf_Sym_Iter.Rafael Espindola2015-06-291-33/+30
| | | | | | | | | | | | | | | | | | | It was a fairly broken concept for an ELF only class. An ELF file can have two symbol tables, but they have exactly the same format. There is no concept of a dynamic or a static symbol. Storing this on the iterator also makes us do more work per symbol than necessary. To fetch a name we would: * Find if we had a static or a dynamic symbol. * Look at the corresponding symbol table and find the string table section. * Look at the string table section to fetch its contents. * Compute the name as a substring of the string table. All but the last step can be done per symbol table instead of per symbol. This is a step in that direction. llvm-svn: 240939
* [StackMaps] Add a lightweight parser for stackmap version 1 sections.Lang Hames2015-06-261-0/+25
| | | | | | | | | | The parser provides a convenient interface for reading llvm stackmap v1 sections in object files. This patch also includes a new option for llvm-readobj, '-stackmap', which uses the parser to pretty-print stackmap sections for debugging/testing purposes. llvm-svn: 240860
* AMDGPU/SI: Set ELF OS/ABI to ELFOSABI_AMDGPU_HSATom Stellard2015-06-261-1/+7
| | | | | | | | | | Reviewers: arsenm, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10708 llvm-svn: 240832
* [Object][ELF] Add support for dumping dynamic relocations when sections are ↵Michael J. Spencer2015-06-251-0/+37
| | | | | | stripped. llvm-svn: 240703
* Don't get confused with sections whose section number is reserved.Rafael Espindola2015-06-241-3/+1
| | | | | | | It is perfectly possible for SHNDX to contain indexes that have the same value as reserved st_shndx values. llvm-svn: 240544
* Support/ELF: Add EM_AMDGPUTom Stellard2015-06-221-1/+2
| | | | | | | | | | | | Summary: This will be used by the R600 backend. Reviewers: chandlerc, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10389 llvm-svn: 240329
* Fix the build.Rafael Espindola2015-06-191-1/+1
| | | | | | Sorry, I have no idea how grep failed to find this. llvm-svn: 240133
* [llvm-readobj] Print MIPS .reginfo section contentSimon Atanasyan2015-06-161-0/+28
| | | | llvm-svn: 239856
* Have the ELF symbol predicates match more directly the spec.Rafael Espindola2015-06-121-2/+2
| | | | | | | | | | | | | | | | The underlaying issues is that this code can't really know if an OS specific or processor specific section number should return true or false. One option would be to assert or return an error, but that looks like over engineering since extensions are not that common. It seems better to have these be direct implementation of the ELF spec so that they are natural for someone familiar with ELF reading the code. Code that does have to handle OS/Architecture specific values can do it at a higher level. llvm-svn: 239618
OpenPOWER on IntegriCloud