aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump
AgeCommit message (Collapse)AuthorFilesLines
2015-01-08Run clang-format on tools/llvm-objdump/MachODump.cpp again as some of myKevin Enderby1-27/+28
previous changes got in with incorrect formatting. No functional change. llvm-svn: 225417
2015-01-07Slightly refactor things for llvm-objdump and the -macho option so it can be ↵Kevin Enderby3-47/+98
used with options other than just -disassemble so that universal files can be used with other options combined with -arch options. No functional change to existing options and use. One test case added for the additional functionality with a universal file an a -arch option. llvm-svn: 225383
2015-01-06Don't loop endlessly for MachO files with 0 ncmdsFilipe Cabecinhas1-0/+2
llvm-svn: 225271
2014-12-24Another attempt to fix the LLVM Windows build bot lld-x86_64-win7, one last ↵Kevin Enderby1-1/+1
place to fix I think. llvm-svn: 224794
2014-12-23Attempt to fix the LLVM Windows build bot lld-x86_64-win7.Kevin Enderby1-1/+1
llvm-svn: 224793
2014-12-23Add printing the LC_THREAD load commands with llvm-objdump’s -private-headers.Kevin Enderby1-0/+352
llvm-svn: 224792
2014-12-20strnlen isn't available on some platforms, use StringRef insteadDavid Majnemer1-1/+2
llvm-svn: 224679
2014-12-19Add printing the LC_ROUTINES load commands with llvm-objdump’s ↵Kevin Enderby1-0/+40
-private-headers. llvm-svn: 224627
2014-12-19Add printing the LC_SUB_CLIENT load command with llvm-objdump’s ↵Kevin Enderby1-0/+18
-private-headers. llvm-svn: 224616
2014-12-19Add printing the LC_SUB_LIBRARY load command with llvm-objdump’s ↵Kevin Enderby1-0/+20
-private-headers. llvm-svn: 224607
2014-12-18Add printing the LC_SUB_UMBRELLA load command with llvm-objdump’s ↵Kevin Enderby1-0/+19
-private-headers. llvm-svn: 224548
2014-12-18Add printing the LC_SUB_FRAMEWORK load command with llvm-objdump’s ↵Kevin Enderby1-0/+19
-private-headers. llvm-svn: 224534
2014-12-18Add printing the LC_LINKER_OPTION load command with llvm-objdump’s ↵Kevin Enderby1-0/+33
-private-headers. Also corrected the name of the load command to not end in an ’S’ as well as corrected the name of the MachO::linker_option_command struct and other places that had the word option as plural which did not match the Mac OS X headers. llvm-svn: 224485
2014-12-17Remove unused includes and out of date comment. NFC.Rafael Espindola1-1/+0
llvm-svn: 224413
2014-12-17Add printing the LC_ENCRYPTION_INFO_64 load command with llvm-objdump’s ↵Kevin Enderby1-1/+26
-private-headers and add tests for the two AArch64 binaries. llvm-svn: 224400
2014-12-16Add printing the LC_ENCRYPTION_INFO load command with llvm-objdump’s ↵Kevin Enderby1-0/+24
-private-headers. llvm-svn: 224390
2014-12-16Fix a bug in llvm-objdump’s -private-headers for the LC_VERSION_MIN_IPHONEOSKevin Enderby1-1/+2
load command not getting printed. llvm-svn: 224376
2014-12-16Fix another use of PRIx32 that should have been PRIx64.Kevin Enderby1-2/+2
llvm-svn: 224368
2014-12-16Fix the arm build bots for a test that was added. A printing routine was ↵Kevin Enderby1-2/+2
incorrectly using PRIx32 when it should have been using PRIx64 for the value that was passed as uint64_t . llvm-svn: 224350
2014-12-16Fix a bug in llvm-objdump’s -private-headers for 32-bit Mach-O filesKevin Enderby1-1/+1
printing the section header. And add some tests for this for 32-bit files. llvm-svn: 224302
2014-12-09Return ErrorOr<std::unique_ptr<Archive>> form getAsArchive.Rafael Espindola1-6/+8
This is the same return type of Archive::create. llvm-svn: 223827
2014-12-04Re-add support to llvm-objdump for Mach-O universal files and archives with ↵Kevin Enderby2-18/+241
-macho with fixes. Includes the move of tests for llvm-objdump for universal files to an X86 directory. And the fix where it was failing on linux Rafael tracked down with asan. I had both Jim Grosbach and Adam Hemet look over the second fix since I could not set up asan to reproduce with the old version but not with the fix. llvm-svn: 223416
2014-12-04Add mach-o LC_RPATH support to llvm-objdumpJean-Daniel Dupas1-0/+19
Summary: Add rpath load command support in Mach-O object and update llvm-objdump to use it. Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6512 llvm-svn: 223343
2014-12-03This reverts commit r223306 and r223277.Rafael Espindola2-241/+18
The code is using uninitialized memory and failing on linux. llvm-svn: 223315
2014-12-03Add support to llvm-objdump for Mach-O universal files and archives with -macho.Kevin Enderby2-18/+241
llvm-svn: 223277
2014-11-26Object/COFF: Fix off-by-one error for object having lots of relocationsRui Ueyama1-1/+3
llvm-objdump printed out an error message for this off-by-one error, but because it always exits with 0 whether or not it found an error, the test (llvm-objdump/coff-many-relocs.test) succeeded. I made llvm-objdump exit with EXIT_FAILURE when an error is found. llvm-svn: 222852
2014-11-19Fix Use-of-uninitialized-value for adrp_addr and adrp_inst in MachODump.cppKevin Enderby1-0/+4
Fixes PR21607 llvm-svn: 222385
2014-11-17Object, COFF: Tighten the object file parserDavid Majnemer1-2/+1
We were a little lax in a few areas: - We pretended that import libraries were like any old COFF file, they are not. In fact, they aren't really COFF files at all, we should probably grow some specialized functionality to handle them smarter. - Our symbol iterators were more than happy to attempt to go past the end of the symbol table if you had a symbol with a bad list of auxiliary symbols. llvm-svn: 222124
2014-11-14Add the code and test cases for 64-bit ARM to llvm-objdump’s Mach-O ↵Kevin Enderby1-23/+185
symbolizer. FYI, removed the unused MCInstrAnalysis as it does not exist for 64-bit ARM and was causing a “couldn't initialize disassembler for target” error. llvm-svn: 222045
2014-11-13Object, Mach-O: Refactor and clean code upDavid Majnemer1-6/+7
Don't assert if we can return an error code, reuse existing functionality like is64Bit(). llvm-svn: 221915
2014-11-12Fixing more -Wcast-qual warnings; NFC.Aaron Ballman2-6/+14
llvm-svn: 221782
2014-11-12Remove the now unused StringRefMemoryObject.h.Rafael Espindola1-1/+0
llvm-svn: 221755
2014-11-12Pass an ArrayRef to MCDisassembler::getInstruction.Rafael Espindola2-20/+18
With this patch MCDisassembler::getInstruction takes an ArrayRef<uint8_t> instead of a MemoryObject. Even on X86 there is a maximum size an instruction can have. Given that, it seems way simpler and more efficient to just pass an ArrayRef to the disassembler instead of a MemoryObject and have it do a virtual call every time it wants some extra bytes. llvm-svn: 221751
2014-11-11Fix a warning about ‘r_type’ may be used uninitialized.Kevin Enderby1-1/+1
Thanks to Aaron Ballman for noticing this! llvm-svn: 221696
2014-11-11llvm-objdump: Skip empty sections when dumping contentsDavid Majnemer1-3/+6
Empty sections are just noise when using objdump. This is similar to what binutils does. llvm-svn: 221680
2014-11-07Use StringRefMemoryObject. NFC.Rafael Espindola1-34/+5
llvm-svn: 221502
2014-11-06Plumb in the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler andKevin Enderby1-24/+235
add the code and test cases for 32-bit ARM symbolizer. Also fixed the printing of data in code as it was not using the table correctly and needed to fix one of the test cases too. This will break lld’s test/mach-o/arm-interworking-movw.yaml till the tweak for that is made. Which I’ll be committing immediately after this commit. llvm-svn: 221470
2014-11-04llvm-objdump: Pass DiceTableEntry by referenceDavid Majnemer1-2/+2
DiceTableEntry is 24 bytes on my machine, it's probably better to pass them by reference. This fixes PR21464. llvm-svn: 221247
2014-11-04Add the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O ↵Kevin Enderby1-14/+94
symbolizer. llvm-svn: 221211
2014-10-29Run clang-format on tools/llvm-objdump/MachODump.cpp . No functional change.Kevin Enderby1-113/+82
llvm-svn: 220875
2014-10-28Update llvm-objdump’s Mach-O symbolizer code to demangle C++ names.Kevin Enderby1-6/+41
llvm-svn: 220833
2014-10-23MachODump.cpp: fix MSVC buildHans Wennborg1-4/+4
llvm-svn: 220518
2014-10-23Change the name of the field BindTable to bindtable to not over lap the type.Kevin Enderby1-9/+9
Should fix the build bot issues from commit r220500. llvm-svn: 220504
2014-10-23Update llvm-objdump’s Mach-O symbolizer code for Objective-C references.Kevin Enderby1-44/+571
This prints disassembly comments for Objective-C references to CFStrings, Selectors, Classes and method calls. llvm-svn: 220500
2014-10-16[llvm-objdump] Fix -private-headers for mach-o to print all LC_*_DYLIB variantsNick Kledzik1-1/+6
llvm-svn: 219945
2014-10-14[llvm-objdump] Update error message and add test case for mach-o file with ↵Nick Kledzik1-1/+1
bad library ordinals llvm-svn: 219746
2014-10-08Remove bogus std::error_code returns form SectionRef.Rafael Espindola2-64/+30
There are two methods in SectionRef that can fail: * getName: The index into the string table can be invalid. * getContents: The section might point to invalid contents. Every other method will always succeed and returning and std::error_code just complicates the code. For example, a section can have an invalid alignment, but if we are able to get to the section structure at all and create a SectionRef, we will always be able to read that invalid alignment. llvm-svn: 219314
2014-10-02Rename data -> DataRui Ueyama1-1/+1
llvm-svn: 218916
2014-09-30[llvm-objdump] switch some uses of format() to format_hex() and left_justify()Nick Kledzik1-29/+26
llvm-svn: 218649
2014-09-26Update llvm-objdump’s Mach-O symbolizer code to print the name of symbol ↵Kevin Enderby1-1/+96
stubs. So in fully linked images when a call is made through a stub it now gets a comment like the following in the disassembly: callq 0x100000f6c ## symbol stub for: _printf indicating the call is to a symbol stub and which symbol it is for. This is done for branch reference types and seeing if the branch target is in a stub section and if so using the indirect symbol table entry for that stub and using that symbol table entries symbol name. llvm-svn: 218546