summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* We don't need the targets to read objects.Rafael Espindola2015-06-252-4/+0
| | | | llvm-svn: 240684
* 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
* Make getRelocationSection MachO only.Rafael Espindola2015-06-191-1/+1
| | | | | | | | | | | | | | There are 3 types of relocations on MachO * Scattered * Section based * Symbol based On ELF and COFF relocations are symbol based. We were in the strange situation that we abstracted over two of them. This makes section based relocations MachO only. llvm-svn: 240149
* Fix the build.Rafael Espindola2015-06-191-1/+1
| | | | | | Sorry, I have no idea how grep failed to find this. llvm-svn: 240133
* Improve the --expand-relocs handling of MachO.Rafael Espindola2015-06-181-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In a relocation target can take 3 basic forms * A r_value in scattered relocations. * A symbol in external relocations. * A section is non-external relocations. Have the dump reflect that. With this change we go from CHECK-NEXT: Extern: 0 CHECK-NEXT: Type: X86_64_RELOC_SUBTRACTOR (5) CHECK-NEXT: Symbol: 0x2 CHECK-NEXT: Scattered: 0 To just // CHECK-NEXT: Type: X86_64_RELOC_SUBTRACTOR (5) // CHECK-NEXT: Section: __data (2) Since the relocation is with a section, we print the seciton name and don't need to say that it is not scattered or external. Someone motivated can add further special cases for things like ARM64_RELOC_ADDEND and ARM_RELOC_PAIR. llvm-svn: 240073
* [llvm-readobj] Print MIPS .reginfo section contentSimon Atanasyan2015-06-163-0/+35
| | | | 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
* Remove object_error::success and use std::error_code() insteadRui Ueyama2015-06-092-2/+2
| | | | | | | | | | | | make_error_code(object_error) is slow because object::object_category() uses a ManagedStatic variable. But the real problem is that the function is called too frequently. This patch uses std::error_code() instead of object_error::success. In most cases, we return "success", so this patch reduces number of function calls to that function. http://reviews.llvm.org/D10333 llvm-svn: 239409
* [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-082-2/+24
| | | | llvm-svn: 236807
* [llvm-readobj] Print .MIPS.abiflags section contentSimon Atanasyan2015-05-073-1/+130
| | | | | | | | | 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-072-4/+14
| | | | llvm-svn: 236728
* Remove unused variable, found with gcc-5.1 -Wunused-variable.Patrik Hagglund2015-04-271-25/+0
| | | | | | | The variable, MachOSectionTypes, seems to have been unused since its introduction in r178679. llvm-svn: 235863
* [Mips] Support DT_MIPS_OPTIONS dynamic section tag in the llvm-readobjSimon Atanasyan2015-04-201-0/+2
| | | | llvm-svn: 235285
* llvm-readobj: teach it to handle MachO Universal Archive correctlyDavid Blaikie2015-04-131-7/+6
| | | | | | | | | | Patch by Chilledheart (rwindz0@gmail.com). Reviewed By: rafael Differential Revision: http://reviews.llvm.org/D8773 llvm-svn: 234758
* [llvm-readobj] add support for macho universal binary.Rafael Espindola2015-03-241-0/+17
| | | | | | Patch by Keyue Hu (Chilledheart)! llvm-svn: 233107
* 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
* Modify llvm-readobj to dump symbol record bytes.Zachary Turner2015-02-183-14/+33
| | | | | | | | | | This will help us study the format of individual symbol records more closely. Differential Revision: http://reviews.llvm.org/D7664 Reviewed by: Timur Iskhodzhanov llvm-svn: 229730
* 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
* llvm-readobj: add IMAGE_REL_ARM_MOV32(T) to the enumerationSaleem Abdulrasool2015-01-161-0/+1
| | | | | | | Add an additional based relocation to the enumeration of based relocation names. The lack of the enumerator value causes issues when inspecting WoA binaries. llvm-svn: 226314
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-141-1/+1
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
* llvm-readobj: add support to dump COFF export tablesSaleem Abdulrasool2015-01-033-0/+28
| | | | | | | This enhances llvm-readobj to print out the COFF export table, similar to the -coff-import option. This is useful for testing in lld. llvm-svn: 225120
* Correctly handle Tag_CPU_arch_profile.Charlie Turner2014-11-251-1/+1
| | | | | | | | Fix ARMAttributeParser::CPU_arch_profile so that it doesn't switch on the value '0' as a legal value of this build attribute. Change-Id: Ie05a08900a82bb10b78c841b437df747ce3bb38e llvm-svn: 222743
* [llvm-readobj][NFC]Colin LeMahieu2014-11-191-1/+2
| | | | | | Appeasing mingw without C++11 std::to_string llvm-svn: 222369
* llvm-readobj: fix off-by-one error in COFFDumperRui Ueyama2014-11-191-4/+1
| | | | | | | | It printed out base relocation table header as table entry. This patch also makes llvm-readobj to not skip ABSOLUTE entries becuase it was confusing. llvm-svn: 222299
* llvm-readobj: teach it how to dump COFF base relocation tableRui Ueyama2014-11-193-1/+40
| | | | llvm-svn: 222289
* llvm-readobj: Don't print the Characteristics field as the SubsystemDavid Majnemer2014-11-181-1/+1
| | | | | | | We claimed that we were printing the Subystem field when we were actually printing the Characteristics field. llvm-svn: 222216
OpenPOWER on IntegriCloud