summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-readobj] Convert to range-loops.Davide Italiano2015-08-072-6/+4
| | | | llvm-svn: 244300
* Move to llvm-readobj code that is only used there.Rafael Espindola2015-08-062-22/+215
| | | | | | | | | | 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
* [COFF] Add IMAGE_SCN_TYPE_NOLOAD to SectionCharacteristicsDavid Majnemer2015-07-301-0/+1
| | | | llvm-svn: 243658
* [llvm-reaobj] Display COFF-specific sections/tables only if the object is COFF.Davide Italiano2015-07-241-9/+10
| | | | | | Just skip them otherwise. llvm-svn: 243086
* 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-212-2/+8
| | | | 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-213-14/+7
| | | | llvm-svn: 242786
* Add missing c++ marker to .h file.Rafael Espindola2015-07-211-1/+1
| | | | llvm-svn: 242784
* Remove duplicated code.Rafael Espindola2015-07-201-4/+4
| | | | | | Both ELFObjectFile and ELFFile had an implementation of getLoadName. llvm-svn: 242725
* 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-202-34/+24
| | | | | | 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-203-7/+16
| | | | llvm-svn: 242658
* llvm-readobj: call exit(1) on error.Rafael Espindola2015-07-206-91/+61
| | | | | | | | | 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
* Refactor duplicated code. NFC.Rafael Espindola2015-07-201-8/+9
| | | | llvm-svn: 242655
* [Object][ELF] Support dumping hash-tables from files with no section table.Michael J. Spencer2015-07-094-2/+22
| | | | | | 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
* [llvm-readobj] Re-add sanity checking which was accidentally removed in r241764David Majnemer2015-07-091-2/+9
| | | | llvm-svn: 241831
* llvm-readobj: Fix an unused variable after r241764Justin Bogner2015-07-091-2/+3
| | | | llvm-svn: 241783
* Temporarily reverting 241765, 241768, and 241772 to unbreak the build bots.Adrian Prantl2015-07-094-22/+2
| | | | llvm-svn: 241781
* [Object][ELF] Support dumping hash-tables from files with no section table.Michael J. Spencer2015-07-094-2/+22
| | | | llvm-svn: 241765
* [CodeView] Add support for emitting column informationDavid Majnemer2015-07-091-6/+14
| | | | | | | | | | Column information is present in CodeView when the line table subsection has bit 0 set to 1 in it's flags field. The column information is represented as a pair of 16-bit quantities: a starting and ending column. This information is present at the end of the chunk, after all the line-PC pairs. llvm-svn: 241764
* Simplify. NFC.Rafael Espindola2015-07-061-3/+1
| | | | llvm-svn: 241458
* Check that COFF .obj files have sections with zero virtual address spaces.Rafael Espindola2015-07-061-1/+6
| | | | | | | | | | | | | When talking about the virtual address of sections the coff spec says: ... for simplicity, compilers should set this to zero. Otherwise, it is an arbitrary value that is subtracted from offsets during relocation. We don't currently subtract it, so check that it is zero. If some producer does create such files, we can change getRelocationOffset instead. llvm-svn: 241447
* Return ErrorOr from getSymbolAddress.Rafael Espindola2015-07-032-8/+16
| | | | | | | It can fail trying to get the section on ELF and COFF. This makes sure the error is handled. llvm-svn: 241366
* Return ErrorOr from SymbolRef::getName.Rafael Espindola2015-07-024-26/+41
| | | | | | | | | | | | This function can really fail since the string table offset can be out of bounds. Using ErrorOr makes sure the error is checked. Hopefully a lot of the boilerplate code in tools/* can go away once we have a diagnostic manager in Object. llvm-svn: 241297
* Return ErrorOr from getSection.Rafael Espindola2015-07-012-12/+23
| | | | | | | | | | | | | | 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
* Remove Elf_Shdr_Iter. Diagnose files with invalid section header sizes.Rafael Espindola2015-06-301-1/+0
| | | | llvm-svn: 241109
* Use range loops. NFC.Rafael Espindola2015-06-301-30/+24
| | | | llvm-svn: 241105
* Use range loop.Rafael Espindola2015-06-301-8/+6
| | | | llvm-svn: 241104
* Use range loop.Rafael Espindola2015-06-301-5/+4
| | | | llvm-svn: 241100
* Fix the name of the iterator functions to match the coding standards.Rafael Espindola2015-06-302-21/+21
| | | | llvm-svn: 241074
* Don't return error_code from a function that doesn't fail.Rafael Espindola2015-06-302-4/+2
| | | | llvm-svn: 241042
* Don't return error_code from a function that doesn't fail.Rafael Espindola2015-06-301-3/+1
| | | | llvm-svn: 241033
* Don't return error_code from function that never fails.Rafael Espindola2015-06-294-15/+6
| | | | llvm-svn: 241021
* 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-292-41/+37
| | | | | | | | | | | | | | | | | | | 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-266-1/+178
| | | | | | | | | | 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
* Simplify getSymbolType.Rafael Espindola2015-06-261-7/+2
| | | | | | | | This is still a really odd function. Most calls are in object format specific contexts and should probably be replaced with a more direct query, but at least now this is not too obnoxious to use. llvm-svn: 240777
* [Object][ELF] Add support for dumping dynamic relocations when sections are ↵Michael J. Spencer2015-06-253-3/+44
| | | | | | stripped. llvm-svn: 240703
OpenPOWER on IntegriCloud