summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove autoconf supportChris Bieneman2016-01-261-17/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* Update the comments for the macho-invalid-zero-ncmds test and fixKevin Enderby2016-01-261-0/+4
| | | | | | | | llvm-objdump when printing the Mach Header to print the unknown cputype and cpusubtype fields as decimal instead of not printing them at all. And change the test to check for that. llvm-svn: 258826
* Reflect the MC/MCDisassembler split on the include/ level.Benjamin Kramer2016-01-262-4/+4
| | | | | | No functional change, just moving code around. llvm-svn: 258818
* Re-submit r256008 "Improve DWARFDebugFrame::parse to also handle __eh_frame."Igor Laevsky2016-01-263-259/+21
| | | | | | | Originally this change was causing failures on windows buildbots. But those problems were fixed in r258806. llvm-svn: 258811
* [llvm-readobj] Remove dead code. Add an assertion instead.Davide Italiano2016-01-131-2/+3
| | | | | | | | | | When we arrive at the end of the function, the validation of the object has been done already. In theory, so, we should never arrive here with something broken as the object isn't mutated. Practice sometimes proves theory to be wrong, so leave an assertion instead, as suggested by David Blaikie, to catch bugs. llvm-svn: 257570
* [llvm-objdump] Use report_error() and improve error coverage.Davide Italiano2016-01-131-4/+2
| | | | llvm-svn: 257561
* For llvm-objdump, add the option -private-header (without the trailing ’s’)Kevin Enderby2016-01-133-11/+46
| | | | | | | | | | | | | | | to only print the first private header. Which for Mach-O files only prints the Mach header and not the subsequent load commands. Which is used by scripts to match what the darwin otool(1) with the -h flag does without the -l flag. For non-Mach-O files it has the same functionality as -private-headers (with the trailing ’s’). rdar://24158331 llvm-svn: 257548
* COFF: Teach llvm-objdump how to dump DLL forwarder symbols.Rui Ueyama2016-01-121-1/+18
| | | | llvm-svn: 257539
* [WebAssembly] Add a EM_WEBASSEMBLY value, and several bits of code that use it.Dan Gohman2016-01-121-0/+17
| | | | | | | | | A request has been made to the official registry, but an official value is not yet available. This patch uses a temporary value in order to support development. When an official value is recieved, the value of EM_WEBASSEMBLY will be updated. llvm-svn: 257517
* [llvm-objdump] Mark noreturn function as such.Davide Italiano2015-12-292-2/+4
| | | | | | Match attribute in the header to make MSVC happy. llvm-svn: 256560
* [llvm-objdump] Use stderr and not stdout for fatal errors.Davide Italiano2015-12-251-2/+2
| | | | llvm-svn: 256423
* [llvm-objdump] Use appropriate helper. NFC.Davide Italiano2015-12-211-2/+1
| | | | llvm-svn: 256156
* [llvm-objdump] Move COFF function to where it belongs.Davide Italiano2015-12-203-50/+51
| | | | | | | Ideally much more stuff should be moved out of llvm-objdump.cpp, but that will happen later. llvm-svn: 256118
* [llvm-objdump] Fail early if we can't parse the object header.Davide Italiano2015-12-191-4/+5
| | | | llvm-svn: 256108
* Revert "Improve DWARFDebugFrame::parse to also handle __eh_frame."Pete Cooper2015-12-183-21/+259
| | | | | | | | This reverts commit r256008. Its breaking multiple buildbots, although works for me locally. llvm-svn: 256013
* Improve DWARFDebugFrame::parse to also handle __eh_frame.Pete Cooper2015-12-183-259/+21
| | | | | | | | | | | | | | | LLVM MC has single methods which can handle the output of EH frame and DWARF CIE's and FDE's. This code improves DWARFDebugFrame::parse to do the same for parsing. This also allows llvm-objdump to support the --dwarf=frames option which objdump supports. This option dumps the .eh_frame section using the new code in DWARFDebugFrame::parse. http://reviews.llvm.org/D15535 Reviewed by Rafael Espindola. llvm-svn: 256008
* [llvm-objdump] Use report_fatal_error() for a more uniform error handling.Davide Italiano2015-12-171-29/+13
| | | | llvm-svn: 255871
* [llvm-objdump/MachODump] Shrink code a little bit. NFC.Davide Italiano2015-12-151-4/+1
| | | | llvm-svn: 255701
* Factor out some duplication. NFC.Pete Cooper2015-12-141-44/+20
| | | | llvm-svn: 255569
* Start implementing FDE dumping when printing the eh_frame.Pete Cooper2015-12-141-5/+107
| | | | | | | | | | This code adds some simple decoding of the FDE's in an eh_frame. There's still more to be done in terms of error handling and verification. Also, we need to be able to decode the CFI's. llvm-svn: 255550
* Print the eh_frame section in MachoDump.Pete Cooper2015-12-141-1/+180
| | | | | | | | | | | | | | This is the start of work to dump the contents of the eh_frame section. It currently emits CIE entries. FDE entries will come later. It also needs improved error checking which will follow soon. http://reviews.llvm.org/D15502 Reviewed by Kevin Enderby and Lang Hames. llvm-svn: 255546
* [llvm-objdump/MachoDump] Simplify.Davide Italiano2015-12-121-7/+3
| | | | llvm-svn: 255443
* [llvm-objdump/MachODump] Reduce code duplication.Davide Italiano2015-12-111-69/+41
| | | | llvm-svn: 255380
* [llvm-objdump/MachO] Don't cut'n'paste the same code over and over.Davide Italiano2015-12-083-21/+10
| | | | | | Use the appropriate helper instead. llvm-svn: 254990
* [llvm-objdump/MachoDump] Make code much more concise.Davide Italiano2015-12-071-20/+5
| | | | llvm-svn: 254888
* [llvm-objdump] Use report_fatal_error() if we can't find a target.Davide Italiano2015-12-031-8/+2
| | | | llvm-svn: 254654
* Fix LLD testsuite fallout from r253429David Majnemer2015-11-181-4/+4
| | | | llvm-svn: 253432
* [llvm-objdump] Use the COFF export table for additional symbolsDavid Majnemer2015-11-181-57/+118
| | | | | | | | | Most linked executables do not have a symbol table in COFF. However, it is pretty typical to have some export entries. Use those entries to inform the disassembler about potential function definitions and call targets. llvm-svn: 253429
* [Object, MachO] Mark symbols from DATA and BSS sections as ST_DataKuba Brecka2015-11-121-1/+1
| | | | | | | | In `MachOObjectFile::getSymbolType` we currently always return `SymbolRef::ST_Function` for symbols from any section. In order for llvm-symbolizer to correctly symbolize Mach-O globals, symbols from data and BSS sections should return `SymbolRef::ST_Data`. Differential Revision: http://reviews.llvm.org/D14576 llvm-svn: 252867
* Reapply r250906 with many suggested updates from Rafael Espindola.Kevin Enderby2015-11-052-8/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ELF] elfiamcu triple should imply e_machine == EM_IAMCUMichael Kuperstein2015-11-041-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D14109 llvm-svn: 252043
* MachO: support tvOS and watchOS version min commands in llvm-objdumpTim Northover2015-11-021-7/+22
| | | | llvm-svn: 251834
* This can take a const reference. NFC.Rafael Espindola2015-10-311-1/+1
| | | | llvm-svn: 251753
* Simplify handling of archive Symbol tables.Rafael Espindola2015-10-311-7/+2
| | | | | | We only need to store a StringRef. llvm-svn: 251748
* Simplify boolean expressions in tools/llvm-objdump.Rafael Espindola2015-10-241-2/+2
| | | | | | Patch by Richard. llvm-svn: 251215
* Backing out commit r250906 as it broke lld.Kevin Enderby2015-10-212-34/+10
| | | | llvm-svn: 250908
* This removes the eating of the error in Archive::Child::getSize() when the ↵Kevin Enderby2015-10-212-10/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix a bugs in the Mach-O disassembler when disassembling from aKevin Enderby2015-10-101-57/+66
| | | | | | | | | | malformed Mach-O file that caused a crash. This was because of an assert where the code was incorrectly attempting to parse relocation entries off of the sections and the filetype was not an MH_OBJECT. rdar://22983603 llvm-svn: 249921
* Fix use of uninitialized bool, found by ubsan in portion ofRichard Smith2015-10-091-6/+10
| | | | | | test/tools/llvm-objdump/malformed-machos.test added in r249845. llvm-svn: 249909
* Fixed two bugs in llvm-objdump’s printing of Objective-C meta dataKevin Enderby2015-10-091-0/+20
| | | | | | | | | | | from malformed Mach-O files that caused crashes. The first because the offset in a dyld bind table entry was out of range. The second because their was no image info section and the routine printing it did not have the need check to see the section did not exist. rdar://22983603 llvm-svn: 249845
* Fix a bug in llvm-objdump’s printing of Objective-C meta dataKevin Enderby2015-10-081-0/+2
| | | | | | | | | from malformed Mach-O files that caused a crash because of a section header had a size that extended past the end of the file. rdar://22983603 llvm-svn: 249768
* Fix a bug in llvm-objdump’s printing of Objective-C meta dataKevin Enderby2015-10-081-3/+9
| | | | | | | from malformed Mach-O files that caused a crash because of loops in the class meta data. llvm-svn: 249700
* Stop linking all target libraries in llvm-nm and llvm-objdump.Pete Cooper2015-10-072-2/+4
| | | | | | | | | | llvm-nm only needs the target to parse module level assembly in bitcode. It doesn't need a disassembler or codegen. llvm-objdump needs to be able to disassemble a file, but doesn't need asm parsers or codegen. This reduces the sizes of these tools by a few MB each, depending on how many backends are linked in. llvm-svn: 249632
* Fix two bugs in llvm-objdump’s printing of Objective-C meta dataKevin Enderby2015-10-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | from malformed Mach-O files that caused crashes. We recently got about 700 malformed Mach-O files which we have been using the improve the robustness of tools that deal with reading data from object files. These resulted in about 20 small bug fixes to the darwin based tools. The goal here is to also improve the robustness of llvm-objdump and this is the first two fixes. In talking with Tim Northover the approach we thought might be best is to: 1) Only include tests for the malformed Mach-O files that cause crashes (not all 700+ tests). 2) The test should only contain the command line option that caused the crash and not all the others that don’t matter. 3) There should be only one line for the FileCheck that is past the point of the crash if possible and if possible indicates the malformation. Again the goal is to fix crashes and not so much care about how the printing of malformed data comes out. Tim also suggested if we really wanted to add test cases for all 700+ malformed Mach-O files putting them in the regression tests might be an option. But many of these do not cause crashes. llvm-svn: 249479
* [PATCH] D13360: [llvm-objdump] Teach -d about AArch64 mapping symbolsDavide Italiano2015-10-011-0/+49
| | | | | | | | | | AArch64 uses $d* and $x* to interleave between text and data. llvm-objdump didn't know about this so it ended up printing garbage. This patch is a first step towards a solution of the problem. Differential Revision: http://reviews.llvm.org/D13360 llvm-svn: 249083
* [llvm-objdump] Fix time of check to time of use bug.Davide Italiano2015-10-011-3/+0
| | | | | | | There's already a test that covers this situation, so we should be fine. llvm-svn: 248976
* Fix Clang-tidy modernize-use-nullptr warnings in examples and include ↵Hans Wennborg2015-09-291-4/+5
| | | | | | | | | | directories; other minor cleanups. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13172 llvm-svn: 248811
* [objdump] Make iterator operator* return a reference.Benjamin Kramer2015-09-241-1/+1
| | | | | | | This is closer to the expected behavior of an iterator and avoids awkward warnings from clang's -Wrange-loop-analysis below. llvm-svn: 248497
* Use makeArrayRef or None to avoid unnecessarily mentioning the ArrayRef type ↵Craig Topper2015-09-212-10/+10
| | | | | | extra times. NFC llvm-svn: 248140
* Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and ↵Daniel Sanders2015-09-152-7/+5
| | | | | | | | related. NFC. Eric has replied and has demanded the patch be reverted. llvm-svn: 247702
OpenPOWER on IntegriCloud