summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/MachODump.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add the option, -universal-headers, used with -macho to print the Mach-O ↵Kevin Enderby2015-01-091-12/+204
| | | | | | universal headers to llvm-objdump. llvm-svn: 225537
* Run clang-format on tools/llvm-objdump/MachODump.cpp again as some of myKevin Enderby2015-01-081-27/+28
| | | | | | previous changes got in with incorrect formatting. No functional change. llvm-svn: 225417
* Slightly refactor things for llvm-objdump and the -macho option so it can be ↵Kevin Enderby2015-01-071-24/+60
| | | | | | | | | | | | 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
* Don't loop endlessly for MachO files with 0 ncmdsFilipe Cabecinhas2015-01-061-0/+2
| | | | llvm-svn: 225271
* Another attempt to fix the LLVM Windows build bot lld-x86_64-win7, one last ↵Kevin Enderby2014-12-241-1/+1
| | | | | | place to fix I think. llvm-svn: 224794
* Attempt to fix the LLVM Windows build bot lld-x86_64-win7.Kevin Enderby2014-12-231-1/+1
| | | | llvm-svn: 224793
* Add printing the LC_THREAD load commands with llvm-objdump’s -private-headers.Kevin Enderby2014-12-231-0/+352
| | | | llvm-svn: 224792
* strnlen isn't available on some platforms, use StringRef insteadDavid Majnemer2014-12-201-1/+2
| | | | llvm-svn: 224679
* Add printing the LC_ROUTINES load commands with llvm-objdump’s ↵Kevin Enderby2014-12-191-0/+40
| | | | | | -private-headers. llvm-svn: 224627
* Add printing the LC_SUB_CLIENT load command with llvm-objdump’s ↵Kevin Enderby2014-12-191-0/+18
| | | | | | -private-headers. llvm-svn: 224616
* Add printing the LC_SUB_LIBRARY load command with llvm-objdump’s ↵Kevin Enderby2014-12-191-0/+20
| | | | | | -private-headers. llvm-svn: 224607
* Add printing the LC_SUB_UMBRELLA load command with llvm-objdump’s ↵Kevin Enderby2014-12-181-0/+19
| | | | | | -private-headers. llvm-svn: 224548
* Add printing the LC_SUB_FRAMEWORK load command with llvm-objdump’s ↵Kevin Enderby2014-12-181-0/+19
| | | | | | -private-headers. llvm-svn: 224534
* Add printing the LC_LINKER_OPTION load command with llvm-objdump’s ↵Kevin Enderby2014-12-181-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
* Add printing the LC_ENCRYPTION_INFO_64 load command with llvm-objdump’s ↵Kevin Enderby2014-12-171-1/+26
| | | | | | | | -private-headers and add tests for the two AArch64 binaries. llvm-svn: 224400
* Add printing the LC_ENCRYPTION_INFO load command with llvm-objdump’s ↵Kevin Enderby2014-12-161-0/+24
| | | | | | -private-headers. llvm-svn: 224390
* Fix a bug in llvm-objdump’s -private-headers for the LC_VERSION_MIN_IPHONEOSKevin Enderby2014-12-161-1/+2
| | | | | | load command not getting printed. llvm-svn: 224376
* Fix another use of PRIx32 that should have been PRIx64.Kevin Enderby2014-12-161-2/+2
| | | | llvm-svn: 224368
* Fix the arm build bots for a test that was added. A printing routine was ↵Kevin Enderby2014-12-161-2/+2
| | | | | | | | incorrectly using PRIx32 when it should have been using PRIx64 for the value that was passed as uint64_t . llvm-svn: 224350
* Fix a bug in llvm-objdump’s -private-headers for 32-bit Mach-O filesKevin Enderby2014-12-161-1/+1
| | | | | | printing the section header. And add some tests for this for 32-bit files. llvm-svn: 224302
* Return ErrorOr<std::unique_ptr<Archive>> form getAsArchive.Rafael Espindola2014-12-091-6/+8
| | | | | | This is the same return type of Archive::create. llvm-svn: 223827
* Re-add support to llvm-objdump for Mach-O universal files and archives with ↵Kevin Enderby2014-12-041-17/+240
| | | | | | | | | | | -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
* Add mach-o LC_RPATH support to llvm-objdumpJean-Daniel Dupas2014-12-041-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
* This reverts commit r223306 and r223277.Rafael Espindola2014-12-031-240/+17
| | | | | | The code is using uninitialized memory and failing on linux. llvm-svn: 223315
* Add support to llvm-objdump for Mach-O universal files and archives with -macho.Kevin Enderby2014-12-031-17/+240
| | | | llvm-svn: 223277
* Fix Use-of-uninitialized-value for adrp_addr and adrp_inst in MachODump.cppKevin Enderby2014-11-191-0/+4
| | | | | | Fixes PR21607 llvm-svn: 222385
* Add the code and test cases for 64-bit ARM to llvm-objdump’s Mach-O ↵Kevin Enderby2014-11-141-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
* Object, Mach-O: Refactor and clean code upDavid Majnemer2014-11-131-6/+7
| | | | | | | Don't assert if we can return an error code, reuse existing functionality like is64Bit(). llvm-svn: 221915
* Fixing more -Wcast-qual warnings; NFC.Aaron Ballman2014-11-121-4/+10
| | | | llvm-svn: 221782
* Pass an ArrayRef to MCDisassembler::getInstruction.Rafael Espindola2014-11-121-13/+10
| | | | | | | | | | | | 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
* Fix a warning about ‘r_type’ may be used uninitialized.Kevin Enderby2014-11-111-1/+1
| | | | | | Thanks to Aaron Ballman for noticing this! llvm-svn: 221696
* Use StringRefMemoryObject. NFC.Rafael Espindola2014-11-071-34/+5
| | | | llvm-svn: 221502
* Plumb in the ARM thumb symbolizer in llvm-objdump’s Mach-O disassembler andKevin Enderby2014-11-061-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
* llvm-objdump: Pass DiceTableEntry by referenceDavid Majnemer2014-11-041-2/+2
| | | | | | | | | DiceTableEntry is 24 bytes on my machine, it's probably better to pass them by reference. This fixes PR21464. llvm-svn: 221247
* Add the code and test cases for 32-bit Intel to llvm-objdump’s Mach-O ↵Kevin Enderby2014-11-041-14/+94
| | | | | | symbolizer. llvm-svn: 221211
* Run clang-format on tools/llvm-objdump/MachODump.cpp . No functional change.Kevin Enderby2014-10-291-113/+82
| | | | llvm-svn: 220875
* Update llvm-objdump’s Mach-O symbolizer code to demangle C++ names.Kevin Enderby2014-10-281-6/+41
| | | | llvm-svn: 220833
* MachODump.cpp: fix MSVC buildHans Wennborg2014-10-231-4/+4
| | | | llvm-svn: 220518
* Change the name of the field BindTable to bindtable to not over lap the type.Kevin Enderby2014-10-231-9/+9
| | | | | | Should fix the build bot issues from commit r220500. llvm-svn: 220504
* Update llvm-objdump’s Mach-O symbolizer code for Objective-C references.Kevin Enderby2014-10-231-44/+571
| | | | | | | This prints disassembly comments for Objective-C references to CFStrings, Selectors, Classes and method calls. llvm-svn: 220500
* [llvm-objdump] Fix -private-headers for mach-o to print all LC_*_DYLIB variantsNick Kledzik2014-10-161-1/+6
| | | | llvm-svn: 219945
* [llvm-objdump] Update error message and add test case for mach-o file with ↵Nick Kledzik2014-10-141-1/+1
| | | | | | bad library ordinals llvm-svn: 219746
* Remove bogus std::error_code returns form SectionRef.Rafael Espindola2014-10-081-30/+18
| | | | | | | | | | | | | | 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
* [llvm-objdump] switch some uses of format() to format_hex() and left_justify()Nick Kledzik2014-09-301-29/+26
| | | | llvm-svn: 218649
* Update llvm-objdump’s Mach-O symbolizer code to print the name of symbol ↵Kevin Enderby2014-09-261-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
* Since the DisasmMemoryObject only operates on const data, it now only ↵Aaron Ballman2014-09-251-3/+3
| | | | | | accepts a const data pointer. This silences a -Wcast-qual warning. llvm-svn: 218454
* Flush out enough of llvm-objdump’s SymbolizerSymbolLookUp() for Mach-O ↵Kevin Enderby2014-09-241-31/+300
| | | | | | | | | | | | | | | | | | | | | files to get the literal string “Hello world” printed as a comment on the instruction that loads the pointer to it. For now this is just for x86_64. So for object files with relocation entries it produces things like: leaq L_.str(%rip), %rax ## literal pool for: "Hello world\n" and similar for fully linked images like executables: leaq 0x4f(%rip), %rax ## literal pool for: "Hello world\n" Also to allow testing against darwin’s otool(1), I hooked up the existing -no-show-raw-insn option to the Mach-O parser code, added the new Mach-O only -full-leading-addr option to match otool(1)'s printing of addresses and also added the new -print-imm-hex option. llvm-svn: 218423
* [llvm-objdump] properly use c_str() with format("%s"). Improve ↵Nick Kledzik2014-09-171-2/+2
| | | | | | getLibraryShortNameByIndex() error handling. llvm-svn: 217930
* [llvm-objdump] improve error reporting of bad mach-o ordinalsNick Kledzik2014-09-161-2/+8
| | | | llvm-svn: 217909
* Hookup the MCSymbolizer to llvm-objdump’s disassembly for Mach-O files.Kevin Enderby2014-09-161-1/+183
| | | | | | | | | | | | | | First step done in this commit is to get flush out enough of the SymbolizerGetOpInfo() routine to symbolic an X86_64 hello world .o and its loading of the literal string and call to printf. Also the code to symbolicate the X86_64_RELOC_SUBTRACTOR relocation and a test is also added to show a slightly more complicated case. Next will be to flush out enough of SymbolizerSymbolLookUp() to get the literal string “Hello world” printed as a comment on the instruction that load the pointer to it. llvm-svn: 217893
OpenPOWER on IntegriCloud