summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-readobj] Use stderr and not stdout for error messages.Davide Italiano2015-12-231-2/+2
| | | | llvm-svn: 256347
* Reland "[llvm-readobj] Simplify usage of -codeview flag"Reid Kleckner2015-12-163-7/+16
| | | | | | Relands r255790 with fixed tests. llvm-svn: 255793
* Revert "[llvm-readobj] Simplify usage of -codeview flag"Reid Kleckner2015-12-163-16/+7
| | | | | | This reverts commit r255790. llvm-svn: 255791
* [llvm-readobj] Simplify usage of -codeview flagReid Kleckner2015-12-163-7/+16
| | | | llvm-svn: 255790
* [llvm-readobj] s/FunctionName/LinkageName/ for codeview dumpingReid Kleckner2015-12-151-7/+7
| | | | | | | The symbol being printed in this field comes from the main symbol table, not 0xF1 subsection. Use LinkageName to make that a lot clearer. llvm-svn: 255596
* [llvm-readobj] report_error() does not return, so we can simplify.Davide Italiano2015-12-051-6/+2
| | | | llvm-svn: 254868
* Fix llvm-readobj build on Windows, match noreturn attribute on reportError ↵Reid Kleckner2015-12-041-1/+2
| | | | | | in headers llvm-svn: 254769
* [llvm-readobj] reportError() never returns. Mark with the correct attribute.Davide Italiano2015-12-041-1/+1
| | | | llvm-svn: 254752
* [llvm-readobj/ELF] Simplify Verdef handling.Davide Italiano2015-12-041-7/+1
| | | | llvm-svn: 254751
* Reapply r250906 with many suggested updates from Rafael Espindola.Kevin Enderby2015-11-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The needed lld matching changes to be submitted immediately next, but this revision will cause lld failures with this alone which is expected. This removes the eating of the error in Archive::Child::getSize() when the characters in the size field in the archive header for the member is not a number. To do this we have all of the needed methods return ErrorOr to push them up until we get out of lib. Then the tools and can handle the error in whatever way is appropriate for that tool. So the solution is to plumb all the ErrorOr stuff through everything that touches archives. This include its iterators as one can create an Archive object but the first or any other Child object may fail to be created due to a bad size field in its header. Thanks to Lang Hames on the changes making child_iterator contain an ErrorOr<Child> instead of a Child and the needed changes to ErrorOr.h to add operator overloading for * and -> . We don’t want to use llvm_unreachable() as it calls abort() and is produces a “crash” and using report_fatal_error() to move the error checking will cause the program to stop, neither of which are really correct in library code. There are still some uses of these that should be cleaned up in this library code for other than the size field. The test cases use archives with text files so one can see the non-digit character, in this case a ‘%’, in the size field. These changes will require corresponding changes to the lld project. That will be committed immediately after this change. But this revision will cause lld failures with this alone which is expected. llvm-svn: 252192
* ARM: support .watchos_version_min and .tvos_version_min.Tim Northover2015-10-281-30/+38
| | | | | | | | These MachO file directives are used by linkers and other tools to provide compatibility information, much like the existing .ios_version_min and .macosx_version_min. llvm-svn: 251569
* [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
* Backing out commit r250906 as it broke lld.Kevin Enderby2015-10-211-6/+1
| | | | llvm-svn: 250908
* This removes the eating of the error in Archive::Child::getSize() when the ↵Kevin Enderby2015-10-211-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | characters in the size field in the archive header for the member is not a number. To do this we have all of the needed methods return ErrorOr to push them up until we get out of lib. Then the tools and can handle the error in whatever way is appropriate for that tool. So the solution is to plumb all the ErrorOr stuff through everything that touches archives. This include its iterators as one can create an Archive object but the first or any other Child object may fail to be created due to a bad size field in its header. Thanks to Lang Hames on the changes making child_iterator contain an ErrorOr<Child> instead of a Child and the needed changes to ErrorOr.h to add operator overloading for * and -> . We don’t want to use llvm_unreachable() as it calls abort() and is produces a “crash” and using report_fatal_error() to move the error checking will cause the program to stop, neither of which are really correct in library code. There are still some uses of these that should be cleaned up in this library code for other than the size field. Also corrected the code where the size gets us to the “at the end of the archive” which is OK but past the end of the archive will return object_error::parse_failed now. The test cases use archives with text files so one can see the non-digit character, in this case a ‘%’, in the size field. llvm-svn: 250906
* Make a bunch of static arrays const.Craig Topper2015-10-181-32/+38
| | | | llvm-svn: 250642
* StreamWriter: List basic types instead of derived ones in HexNumberMatthias Braun2015-10-171-8/+11
| | | | | | | | This avoids problems with different (u)intXX definition on different platforms. Specifically this fixes a case on OS/X which had uint64_t defined as unsigned long long. llvm-svn: 250589
* [llvm-readobj] Teach ELFDumper about symbol versioning.Davide Italiano2015-10-163-6/+106
| | | | | | 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-144-0/+44
| | | | | | | | 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
* Added missing test for [ARM] AttributeParser. Check that build attributeAlexandros Lamprineas2015-10-051-1/+1
| | | | | | | | Tag_Advanced_SIMD_arch is set correctly when targeting v8.1-a NEON. Differential Revision: http://reviews.llvm.org/D13281 llvm-svn: 249304
* Fix printing of 64 bit values and make test more strict.Rafael Espindola2015-10-011-5/+4
| | | | llvm-svn: 249043
* [llvm-readobj/MachO] Ensure we always have valid CmdName/SegmentName.Davide Italiano2015-09-221-2/+2
| | | | | | | | Otherwise we might end up printing garbage while dumping. Differential Revision: http://reviews.llvm.org/D13041 llvm-svn: 248239
* Avoid SEGFAULT if a requested symbol section is absent.Rafael Espindola2015-09-211-0/+2
| | | | | | Patch by Igor Kudrin! llvm-svn: 248194
* Use makeArrayRef or None to avoid unnecessarily mentioning the ArrayRef type ↵Craig Topper2015-09-211-1/+1
| | | | | | extra times. NFC llvm-svn: 248140
* [llvm-readobj] Fix another "time of check to time of use bug".Davide Italiano2015-09-171-5/+0
| | | | | | It seems there's more copy-paste between tools than needed. llvm-svn: 247954
* [llvm-readobj] MachO -- dump LinkerOptions load command.Davide Italiano2015-09-093-0/+28
| | | | | | | | | | | | | | | | | | | | Example output: Linker Options { Size: 32 Count: 2 Strings [ Value: -framework Value: Cocoa ] } There were only two tests using this -- so I converted them as part of this commit rather than separately. Differential Revision: http://reviews.llvm.org/D12702 llvm-svn: 247106
* [llvm-readobj] MachO: dump the correct field.Davide Italiano2015-09-041-1/+1
| | | | | | | This was found while converting a test from macho-dump to llvm-readobj and will once I commit the converted test. llvm-svn: 246868
* [llvm-readobj] Dump MachO indirect symbols.Davide Italiano2015-09-033-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example output: File: <stdin> Format: Mach-O 32-bit i386 Arch: i386 AddressSize: 32bit Indirect Symbols { Number: 3 Symbols [ Entry { Entry Index: 0 Symbol Index: 0x4 } Entry { Entry Index: 1 Symbol Index: 0x0 } Entry { Entry Index: 2 Symbol Index: 0x1 } ] } Differential Revision: http://reviews.llvm.org/D12570 llvm-svn: 246789
* [llvm-readobj] MachO: Dump segment command.Davide Italiano2015-09-023-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | Example output: File: <stdin> Format: Mach-O arm Arch: arm AddressSize: 32bit Segment { Cmd: LC_SEGMENT Name: Size: 260 vmaddr: 0x0 vmsize: 0x10 fileoff: 408 filesize: 408 maxprot: rwx initprot: rwx nsects: 3 flags: 0x0 } Differential Revision: http://reviews.llvm.org/D12542 llvm-svn: 246665
* Pass a symbol table to getRelocationSymbol instead of returning one.Rafael Espindola2015-09-022-21/+24
| | | | | | | This removes a report_fatal_error from library and avoids checking a section property for every section entry. llvm-svn: 246656
* [llvm-readobj] MachO -- correctly dump section field 'Reserved3'Davide Italiano2015-09-011-0/+4
| | | | | | Before we incorrectly ignored it. llvm-svn: 246556
* [llvm-readobj] Dump MachO Dysymtab command.Davide Italiano2015-08-313-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example output: File: <stdin> Format: Mach-O 64-bit x86-64 Arch: x86_64 AddressSize: 64bit Dysymtab { ilocalsym: 0 nlocalsym: 6 iextdefsym: 6 nextdefsym: 2 iundefsym: 8 nundefsym: 0 tocoff: 0 ntoc: 0 modtaboff: 0 nmodtab: 0 extrefsymoff: 0 nextrefsyms: 0 indirectsymoff: 0 nindirectsyms: 0 extreloff: 0 nextrel: 0 locreloff: 0 nlocrel: 0 } Differential Revision: http://reviews.llvm.org/D12496 llvm-svn: 246474
* [llvm-readobj] Add pair of missing braces.Davide Italiano2015-08-311-1/+2
| | | | | | This fixes a regression introduced in r246151. llvm-svn: 246453
* llvm-readobj: Dump more info for COFF import libraries.Rui Ueyama2015-08-284-7/+57
| | | | | | This patch teaches llvm-readobj to print out COFF import file header fields. llvm-svn: 246291
* Re-apply r246276 - Object: Teach llvm-ar to create symbol table for COFF ↵Rui Ueyama2015-08-281-0/+9
| | | | | | | | | | | short import files This patch includes a fix for a llvm-readobj test. With this patch, the tool does no longer print out COFF headers for the short import file, but that's probably desirable because the header for the short import file is dummy. llvm-svn: 246283
* [llvm-readobj] Add support for dumping MachO min version load command.Davide Italiano2015-08-273-0/+45
| | | | | | | | | | | | | | | | | | Example output: File: <stdin> Format: Mach-O arm Arch: arm AddressSize: 32bit MinVersion { Cmd: LC_VERSION_MIN_IPHONEOS Size: 16 Version: 99.8.7 SDK: n/a } Differential Revision: http://reviews.llvm.org/D12373 llvm-svn: 246151
* [llvm-readobj/ELF] Factor out common code.Davide Italiano2015-08-231-12/+11
| | | | llvm-svn: 245813
* [llvm-readobj] Add support for MachO DataInCodeDataCommand.Davide Italiano2015-08-213-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example output: File: <stdin> Format: Mach-O arm Arch: arm AddressSize: 32bit DataInCode { Data offset: 300 Data size: 32 Data Regions [ DICE { Index: 0 Offset: 0 Length: 4 Kind: 1 } DICE { Index: 1 Offset: 4 Length: 4 Kind: 4 } DICE { Index: 2 Offset: 8 Length: 2 Kind: 3 } DICE { Index: 3 Offset: 10 Length: 1 Kind: 2 } ] } Differential Revision: http://reviews.llvm.org/D12084 llvm-svn: 245732
* Don't iterate over all sections in the ELFFile constructor.Rafael Espindola2015-08-102-13/+35
| | | | | | | 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-102-11/+19
| | | | | | Another step in avoiding iterating over all sections in the ELFFile constructor. llvm-svn: 244496
* Use continue to reduce indentation. NFC.Rafael Espindola2015-08-101-17/+19
| | | | llvm-svn: 244480
* Convert getSymbolSection to return an ErrorOr.Rafael Espindola2015-08-073-9/+8
| | | | | | | This function can actually fail since the symbol contains an index to the section and that can be invalid. llvm-svn: 244375
* 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-072-3/+3
| | | | | | 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-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
OpenPOWER on IntegriCloud