summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-objdump
Commit message (Collapse)AuthorAgeFilesLines
...
* Print the eh_frame section in MachoDump.Pete Cooper2015-12-142-0/+18
| | | | | | | | | | | | | | 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] Use the COFF export table for additional symbolsDavid Majnemer2015-11-182-0/+8
| | | | | | | | | 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-3/+3
| | | | | | | | 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-054-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Backing out commit r250906 as it broke lld.Kevin Enderby2015-10-214-62/+0
| | | | llvm-svn: 250908
* This removes the eating of the error in Archive::Child::getSize() when the ↵Kevin Enderby2015-10-214-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Tweak to r250117 and change to use ErrorOr and drop isSizeValid forKevin Enderby2015-10-131-7/+0
| | | | | | | | | | ArchiveMemberHeader, suggestion by Rafael Espíndola. Also The clang-x86-win2008-selfhost bot still does not like the malformed-machos 00000031.a test, so removing it for now. All the other bots are fine with it however. llvm-svn: 250222
* The issue with the malformed-machos 00000031.a test is that it needed ↵Kevin Enderby2015-10-131-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ‘-arch x86_64’ flag as it was a Mach-O universal file. The default as to which architecture slice that is dumped without an -arch flag depends on the host architecture and the contents of the universal file. The malformed archive 00000031.a file has both an x86_64 and i386 slice. So for for x86_64 hosts only that slice is dumped, for non-x86_64 hosts, which is many of the bots both slices are dumped. The test is intended to only check that the malformation of the x86_64 which has a non-decimal characters in the size field of the archive header so it no longer crashes. The problem turned out that the i388 slice of the malformed archive had a different malformation which was causing the non-x86_64 bots to get this error: llvm-objdump -macho -disassemble -arch i386 00000031.a Archive : .00000031.a 00000031.a(c_start.o): LLVM ERROR: Symbol name entry points before beginning or past end of file. and causing the test as it was written to fail. So by adding ‘-arch x86_64’ it should correct the test and the malformation on the i388 slice will not be dumped. Also the removal of the malformed-machos mem-crup-0261.macho was not causing the issue so that is put back in. Sorry for the churn on these tests, Kev llvm-svn: 250184
* Looks like malformed-machos 00000031.a test is just getting a different errorKevin Enderby2015-10-131-6/+0
| | | | | | on some of the bots. I’ll remove this test for now. llvm-svn: 250141
* Remove the correct unstable malformed-machos test mem-crup-0261.macho andKevin Enderby2015-10-131-3/+6
| | | | | | | restore the malformed-machos 00000031.a test. Hopefully this will get all the build bots happy again. I’ll again keep an eye on them. llvm-svn: 250130
* Temporarily remove the test added in r250117 while I investigate why twoKevin Enderby2015-10-121-6/+0
| | | | | | of the build bots get a different error on that malformed file. llvm-svn: 250120
* Fixed bugs in llvm-obdump while parsing Mach-O files from malformed archivesKevin Enderby2015-10-122-0/+6
| | | | | | | | | that caused aborts. This was because of the characters of the ‘Size’ field in the archive header did not contain decimal characters. rdar://22983603 llvm-svn: 250117
* Move llvm-objdump malformed Mach-O tests to X86 test directory.Kevin Enderby2015-10-108-0/+0
| | | | | | rdar://22983603 llvm-svn: 249927
* Fix a bugs in the Mach-O disassembler when disassembling from aKevin Enderby2015-10-102-0/+6
| | | | | | | | | | 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
* Fixed two bugs in llvm-objdump’s printing of Objective-C meta dataKevin Enderby2015-10-093-0/+9
| | | | | | | | | | | 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-082-0/+6
| | | | | | | | | 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-082-0/+6
| | | | | | | from malformed Mach-O files that caused a crash because of loops in the class meta data. llvm-svn: 249700
* Fix two bugs in llvm-objdump’s printing of Objective-C meta dataKevin Enderby2015-10-063-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+30
| | | | | | | | | | 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
* COFF: Assign the correct symbol type to internal functions.Peter Collingbourne2015-08-062-0/+3
| | | | | | | | | | | The COFFSymbolRef::isFunctionDefinition() function tests for several conditions that are not related to whether a symbol is a function, but rather whether the symbol meets the requirements for a function definition auxiliary record, which excludes certain symbols such as internal functions and undefined references. The test we need to determine the symbol type is much simpler: we only need to compare the complex type against IMAGE_SYM_DTYPE_FUNCTION. llvm-svn: 244195
* [llvm-objdump] Merging MachO DumpSections in to FilterSections. Simplifying ↵Colin LeMahieu2015-07-291-1/+1
| | | | | | some predicate logic. llvm-svn: 243556
* [llvm-objdump] Added -j flag to filter sections that are operated on.Colin LeMahieu2015-07-292-0/+7
| | | | llvm-svn: 243526
* Moving tests in to X86 directory.Colin LeMahieu2015-07-232-0/+0
| | | | llvm-svn: 243049
* Using an input object file instead of trying to generate an object file.Colin LeMahieu2015-07-232-5/+2
| | | | llvm-svn: 243044
* Specifying a test triple.Colin LeMahieu2015-07-231-1/+2
| | | | llvm-svn: 243042
* [llvm-objdump] Add -D and --disassemble-all flags that attempt disassembly ↵Colin LeMahieu2015-07-231-0/+6
| | | | | | on all sections instead of just text sections. llvm-svn: 243041
* llvm-objdump: Replace the -macho -raw option with a generic -raw-clang-astAdrian Prantl2015-07-081-2/+0
| | | | | | | | | | | | | | | option that works with all object container formats. Now that clang modules/PCH are object containers this option is useful to to construct pipes like llvm-objdump -raw-clang-ast foo.pcm | llvm-bcanalyzer - to inspect the AST contents in a PCH container. Will be tested via clang. Belatedly addresses review feedback for r233390. llvm-svn: 241659
* objdump: Don't print a (always 0) size for MachO symbols.Rafael Espindola2015-06-231-5/+5
| | | | | | | | | | | Only common symbol on MachO and COFF have a size. For COFF we already had a custom format. For MachO, there is no native objdump and we were printing it as ELF. Now we only print the sizes for symbols that actually have them. llvm-svn: 240422
* Have MachOObjectFile::isValidArch() accept armv7Frederic Riss2015-06-161-0/+1
| | | | llvm-svn: 239833
* Fix buildbot failure on Windows by relaxing test expectations.Alexey Samsonov2015-06-041-1/+2
| | | | llvm-svn: 239074
* llvm-objdump: return non-zero exit code for certain cases of invalid inputAlexey Samsonov2015-06-041-0/+5
| | | | | | | | * If the input file is missing; * If the type of input object file can't be recognized; * If the object file can't be parsed correctly. llvm-svn: 239065
* Stop inventing symbol sizes.Rafael Espindola2015-05-221-4/+4
| | | | | | | | | | | | | | | | | | | | | MachO and COFF quite reasonably only define the size for common symbols. We used to try to figure out the "size" by computing the gap from one symbol to the next. This would not be correct in general, since a part of a section can belong to no visible symbol (padding, private globals). It was also really expensive, since we would walk every symbol to find the size of one. If a caller really wants this, it can sort all the symbols once and get all the gaps ("size") in O(n log n) instead of O(n^2). On MachO this also has the advantage of centralizing all the checks for an invalid n_sect. llvm-svn: 238028
* For llvm-objdump, with the -archive-headers and -macho options, use the ↵Kevin Enderby2015-04-301-0/+18
| | | | | | | | | | -non-verbose option to print the archive headers using raw numeric values. Also add the -archive-member-offsets for use with these to also trigger printing of the offset of the archive member from the start of the archive. llvm-svn: 236252
* For llvm-objdump, dump the (__OBJC,__protocol) section for Objc1 32-bit ↵Kevin Enderby2015-04-161-0/+139
| | | | | | | | Mach-O files with the -section option as objc_protocol_t structs. llvm-svn: 235141
* For llvm-objdump added support for printing Objc1 32-bit runtime meta dataKevin Enderby2015-04-163-0/+285
| | | | | | with the existing -objc-meta-data and -macho options for Mach-O files. llvm-svn: 235119
* Fix failure on builder llvm-clang-lld-x86_64-debian-fast as theKevin Enderby2015-04-061-1/+0
| | | | | | test macho-objc-meta-data.test had a line it shouldn't have had. llvm-svn: 234190
* For llvm-objdump added support for printing Objc2 32-bit runtime meta dataKevin Enderby2015-04-063-0/+410
| | | | | | with the existing -objc-meta-data and -macho options for Mach-O files. llvm-svn: 234185
* Add the option -objc-meta-data to llvm-objdump used with -macho toKevin Enderby2015-04-013-0/+206
| | | | | | | | | | print the Objective-C runtime meta data for Mach-O files. There are three types of Objective-C runtime meta data, Objc2 64-bit, Objc2 32-bit and Objc1 32-bit. This prints the first of these types. The changes to print the others will follow next. llvm-svn: 233840
* [Objdump] Pass the correct subtarget to printInst.Akira Hatanaka2015-03-282-0/+3
| | | | | | This fixes a bug I introduced in r233411. llvm-svn: 233484
* Add a -raw option to the -section mode of llvm-objdump.Adrian Prantl2015-03-271-0/+5
| | | | llvm-svn: 233390
* Add the option -no-symbolic-operands to llvm-objdump used with -macho andKevin Enderby2015-03-171-0/+9
| | | | | | -disassemble to not symbolic operands when disassembling. llvm-svn: 232558
* Add the option, -no-leading-addr llvm-objdump used with -macho andKevin Enderby2015-03-172-0/+29
| | | | | | -disassemble or -section to not print the leading addresses on each line. llvm-svn: 232547
* Add the option, -dis-symname to llvm-objdump used with -macho andKevin Enderby2015-03-171-0/+19
| | | | | | -disassemble to disassemble just one symbol’s instructions. llvm-svn: 232503
* Add the options, -dylibs-used and -dylib-id to llvm-objdump used with -machoKevin Enderby2015-03-161-0/+6
| | | | | | | to print the Mach-O dynamic shared libraries used by a linked image or the library id of a shared library. llvm-svn: 232406
* Add the option, -non-verbose to llvm-objdump used with -macho to print thingsKevin Enderby2015-03-139-0/+168
| | | | | | | | | | using numeric values and not their symbolic constant names. The routines that print Mach-O stuff already had a verbose parameter and this change is just changing the passing true to passing !NonVerbose. With just a couple of fixes and a bunch of test case updates. llvm-svn: 232182
* Add the option, -info-plist to llvm-objdump used with -macho to print theKevin Enderby2015-03-111-0/+7
| | | | | | Mach-O info plist section as strings. llvm-svn: 231974
* [Objdump] Fixing crash when printing symbols in ELF sections with special types.Colin LeMahieu2015-02-182-0/+3
| | | | llvm-svn: 229759
* Add code to llvm-objdump so the -section option with -macho will dump ↵Kevin Enderby2015-02-174-14/+82
| | | | | | | | | | | literal pointer sections with the Mach-O S_LITERAL_POINTERS section type. Also fix the printing of the leading addresses for literal sections to be consistent and not print the 0x prefix. Updated test cases to match. llvm-svn: 229548
* Add code to llvm-objdump so the -section option with -macho will dump literalKevin Enderby2015-02-061-0/+48
| | | | | | sections with the Mach-O S_{4,8,16}BYTE_LITERALS section types. llvm-svn: 228465
* Add code to llvm-objdump so the -section option with -macho will dump ↵Kevin Enderby2015-02-041-0/+4
| | | | | | | | ‘C’ string sections with the Mach-O S_CSTRING_LITERALS section type. llvm-svn: 228198
OpenPOWER on IntegriCloud