summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/ELFDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [llvm-readobj] Use the new symbol API.Davide Italiano2015-06-081-7/+7
| | | | llvm-svn: 239286
* Fix the interpretation of a 0 st_name.Rafael Espindola2015-06-031-9/+13
| | | | | | | | | | | | | | The ELF spec is very clear: ----------------------------------------------------------------------------- If the value is non-zero, it represents a string table index that gives the symbol name. Otherwise, the symbol table entry has no name. -------------------------------------------------------------------------- In particular, a st_name of 0 most certainly doesn't mean that the symbol has the same name as the section. llvm-svn: 238899
* Simplify now that we always use an alignment of 2 for ELF files.Rafael Espindola2015-06-021-5/+3
| | | | | | This saves 123144 bytes out of llvm-nm on powerpc64le. llvm-svn: 238824
* [llvm-readobj/ELF] Teach how to decode DF_1_XXX flagsDavide Italiano2015-05-251-0/+32
| | | | | | | | | | | | | llvm-readobj -dynamic-table output. Before: 0x000000006FFFFFFB unknown After: 0x000000006FFFFFFB FLAGS_1 NOW ORIGIN Differential Revision: http://reviews.llvm.org/D9958 llvm-svn: 238151
* [llvm-readobj] Teach llvm-readobj to print PT_MIPS_ABIFLAGS program headerSimon Atanasyan2015-05-151-0/+1
| | | | llvm-svn: 237451
* [llvm-readobj/obj2yaml/yaml2obj] Support MIPS machine ELF header flagsSimon Atanasyan2015-05-081-1/+20
| | | | llvm-svn: 236807
* [llvm-readobj] Print .MIPS.abiflags section contentSimon Atanasyan2015-05-071-0/+121
| | | | | | | | | This change adds new flag -mips-abi-flags to the llvm-readobj. This flag forces printing of .MIPS.abiflags section content. https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking#10.2.1._.MIPS.abiflags llvm-svn: 236737
* [llvm-readobj/obj2yaml/yaml2obj] Support more MIPS ELF header flagsSimon Atanasyan2015-05-071-1/+6
| | | | llvm-svn: 236728
* [Mips] Support DT_MIPS_OPTIONS dynamic section tag in the llvm-readobjSimon Atanasyan2015-04-201-0/+2
| | | | llvm-svn: 235285
* Add support for Nuxi CloudABI.Ed Schouten2015-03-091-0/+1
| | | | | | | | | | | | | | CloudABI is a POSIX-like runtime environment built around the concept of capability-based security. More details: https://github.com/NuxiNL/cloudlibc CloudABI uses its own ELFOSABI number. This number has been allocated by the maintainers of ELF a couple of days ago. Reviewed by: echristo llvm-svn: 231681
* Add STB_GNU_UNIQUE to the ELF writer.Rafael Espindola2015-01-231-3/+4
| | | | | | This lets llvm-mc assemble files produced by gcc. llvm-svn: 226895
* Add a test that would have found the bug in r219829.Rafael Espindola2014-10-171-1/+2
| | | | llvm-svn: 220016
* Revert commit r219835 and r219829.Rafael Espindola2014-10-171-2/+1
| | | | | | | | | Revert "Correctly handle references to section symbols." Revert "Allow forward references to section symbols." Rui found a regression I am debugging. llvm-svn: 220010
* Correctly handle references to section symbols.Rafael Espindola2014-10-151-1/+2
| | | | | | | | | | | | | | | | | When processing assembly like .long .text we were creating a new undefined symbol .text. GAS on the other hand would handle that as a reference to the .text section. This patch implements that by creating the section symbols earlier so that they are visible during asm parsing. The patch also updates llvm-readobj to print the symbol number in the relocation dump so that the test can differentiate between two sections with the same name. llvm-svn: 219829
* Object: BSS/virtual sections don't have contentsDavid Majnemer2014-09-261-1/+1
| | | | | | | | | | | | Users of getSectionContents shouldn't try to pass in BSS or virtual sections. In all instances, this is a bug in the code calling this routine. N.B. Some COFF implementations (like CL) will mark their BSS sections as taking space on disk. This would confuse COFFObjectFile into thinking the section is larger than the file. llvm-svn: 218549
* [Mips] Support SHT_MIPS_ABIFLAGS section type flag in the llvm-readobj,Simon Atanasyan2014-07-131-0/+1
| | | | | | obj2yaml and yaml2obj tools. llvm-svn: 212908
* [llvm-readobj] Fix output of MIPS GOT without local and global entries.Simon Atanasyan2014-07-051-1/+1
| | | | llvm-svn: 212374
* [llvm-readobj] Fix member functions name style.Simon Atanasyan2014-06-181-13/+13
| | | | llvm-svn: 211152
* [llvm-readobj] Fix compile error.Simon Atanasyan2014-06-181-1/+1
| | | | llvm-svn: 211151
* [llvm-readobj][ELF] New `-mips-plt-got` command line option to outputSimon Atanasyan2014-06-181-0/+217
| | | | | | | | MIPS GOT section. Patch reviewed by Rafael Espindola. llvm-svn: 211150
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-131-6/+6
| | | | llvm-svn: 210876
* Remove all uses of 'using std::error_code' from headers.Rafael Espindola2014-06-131-0/+1
| | | | llvm-svn: 210866
* [llvm-readobj][ELF] Factor out the code retrieve ELF symbol informationSimon Atanasyan2014-06-101-35/+50
| | | | | | | | (section name, section index, full name) into the separate functions. No functional changes. llvm-svn: 210509
* [Object][ELF] Range-based loop simplification.Simon Atanasyan2014-06-041-13/+10
| | | | | | No functional changes. llvm-svn: 210164
OpenPOWER on IntegriCloud