summaryrefslogtreecommitdiffstats
path: root/llvm/tools/macho-dump/macho-dump.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove macho-dump. Its functionality is now covered by llvm-readobj.Davide Italiano2015-09-221-434/+0
| | | | | | | Approved by: Rafael Espindola, Eric Christopher, Jim Grosbach, Alex Rosenberg llvm-svn: 248302
* [Object, MachO] Introduce MachOObjectFile::load_commands() range iterator.Alexey Samsonov2015-06-031-11/+5
| | | | | | | | | | | | | | | | | | Summary: Now users don't have to manually deal with getFirstLoadCommandInfo() / getNextLoadCommandInfo(), calculate the number of load segments, etc. No functionality change. Test Plan: regression test suite Reviewers: rafael, lhames, loladiro Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10144 llvm-svn: 238983
* Add printing the LC_LINKER_OPTION load command with llvm-objdump’s ↵Kevin Enderby2014-12-181-4/+4
| | | | | | | | | | -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
* Adds the next bit of support for llvm-objdump’s -private-headers for ↵Kevin Enderby2014-09-041-1/+1
| | | | | | | | | executable Mach-O files. This adds the printing of more load commands, so that the normal load commands in a typical X86 Mach-O executable can all be printed. llvm-svn: 217172
* Don't own the buffer in object::Binary.Rafael Espindola2014-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Owning the buffer is somewhat inflexible. Some Binaries have sub Binaries (like Archive) and we had to create dummy buffers just to handle that. It is also a bad fit for IRObjectFile where the Module wants to own the buffer too. Keeping this ownership would make supporting IR inside native objects particularly painful. This patch focuses in lib/Object. If something elsewhere used to own an Binary, now it also owns a MemoryBuffer. This patch introduces a few new types. * MemoryBufferRef. This is just a pair of StringRefs for the data and name. This is to MemoryBuffer as StringRef is to std::string. * OwningBinary. A combination of Binary and a MemoryBuffer. This is needed for convenience functions that take a filename and return both the buffer and the Binary using that buffer. The C api now uses OwningBinary to avoid any change in semantics. I will start a new thread to see if we want to change it and how. llvm-svn: 216002
* Remove some calls to std::move.Rafael Espindola2014-08-011-2/+2
| | | | | | | | | Instead of moving out the data in a ErrorOr<std::unique_ptr<Foo>>, get a reference to it. Thanks to David Blaikie for the suggestion. llvm-svn: 214516
* Use std::unique_ptr to make the ownership explicit.Rafael Espindola2014-07-311-2/+2
| | | | llvm-svn: 214377
* macho-dump: add code to print LC_ID_DYLIB load commands.Tim Northover2014-06-301-0/+13
| | | | | | I want to check them in lld. llvm-svn: 212043
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-131-2/+1
| | | | llvm-svn: 210876
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-121-0/+1
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* Remove system_error.h.Rafael Espindola2014-06-121-1/+1
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
* Darwin: Add assembler directives to create version-min load commands.Jim Grosbach2014-03-181-0/+12
| | | | | | | | | | | | Allow object files to be tagged with a version-min load command for iOS or MacOSX. Teach macho-dump to understand the version-min load commands for testcases. rdar://11337778 llvm-svn: 204190
* [C++11] Introduce ObjectFile::symbols() to use range-based loops.Alexey Samsonov2014-03-171-3/+3
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3081 llvm-svn: 204031
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-1/+1
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-101-1/+1
| | | | llvm-svn: 201108
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-301-4/+3
| | | | | | | | | | | | None of the object file formats reported error on iterator increment. In retrospect, that is not too surprising: no object format stores symbols or sections in a linked list or other structure that requires chasing pointers. As a consequence, all error checking can be done on begin() and end(). This reduces the text segment of bin/llvm-readobj in my machine from 521233 to 518526 bytes. llvm-svn: 200442
* Return an ErrorOr<Binary *> from createBinary.Rafael Espindola2014-01-151-2/+3
| | | | | | | | I did write a version returning ErrorOr<OwningPtr<Binary> >, but it is too cumbersome to use without std::move. I will keep the patch locally and submit when we switch to c++11. llvm-svn: 199326
* Object/COFF: Rename getXXX{Begin,End} -> xxx_{begin,end}.Rui Ueyama2013-09-271-2/+2
| | | | | | | It is mentioned in the LLVM coding standard that _begin() and _end() suffixes should be used. llvm-svn: 191569
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-09-011-122/+119
| | | | llvm-svn: 189728
* Revert "Fix the build broken by r189315." and "Move everything depending on ↵Charles Davis2013-08-271-119/+122
| | | | | | | | | Object/MachOFormat.h over to Support/MachO.h." This reverts commits r189319 and r189315. r189315 broke some tests on what I believe are big-endian platforms. llvm-svn: 189321
* Fix the build broken by r189315.David Blaikie2013-08-271-17/+8
| | | | | | | (this triggered Clang's -Wsometimes-uninitialized on the default path through the switch) llvm-svn: 189319
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-08-271-130/+136
| | | | llvm-svn: 189315
* Teach llvm-objdump with the -macho parser how to use the data in code tableKevin Enderby2013-06-061-1/+1
| | | | | | | | | | | | | | | from the LC_DATA_IN_CODE load command. And when disassembling print the data in code formatted for the kind of data it and not disassemble those bytes. I added the format specific functionality to the derived class MachOObjectFile since these tables only appears in Mach-O object files. This is my first attempt to modify the libObject stuff so if folks have better suggestions how to fit this in or suggestions on the implementation please let me know. rdar://11791371 llvm-svn: 183424
* Use llvm/Object/MachO.h in macho-dumper. Drop the old macho parser.Rafael Espindola2013-04-261-233/+191
| | | | | | | | | | | | | | | | | | | | | For Mach-O there were 2 implementations for parsing object files. A standalone llvm/Object/MachOObject.h and llvm/Object/MachO.h which implements the generic interface in llvm/Object/ObjectFile.h. This patch adds the missing features to MachO.h, moves macho-dump to use MachO.h and removes ObjectFile.h. In addition to making sure that check-all is clean, I checked that the new version produces exactly the same output in all Mach-O files in a llvm+clang build directory (including executables and shared libraries). To test the performance, I ran macho-dump over all the files in a llvm+clang build directory again, but this time redirecting the output to /dev/null. Both the old and new versions take about 4.6 seconds (2.5 user) to finish. llvm-svn: 180624
* [MC/Mach-O] Add support for linker options in Mach-O files.Daniel Dunbar2013-01-181-1/+29
| | | | llvm-svn: 172779
* Refactor data-in-code annotations.Jim Grosbach2012-05-181-0/+32
| | | | | | | | | | | | | | | | | | | | | | Use a dedicated MachO load command to annotate data-in-code regions. This is the same format the linker produces for final executable images, allowing consistency of representation and use of introspection tools for both object and executable files. Data-in-code regions are annotated via ".data_region"/".end_data_region" directive pairs, with an optional region type. data_region_directive := ".data_region" { region_type } region_type := "jt8" | "jt16" | "jt32" | "jta32" end_data_region_directive := ".end_data_region" The previous handling of ARM-style "$d.*" labels was broken and has been removed. Specifically, it didn't handle ARM vs. Thumb mode when marking the end of the section. rdar://11459456 llvm-svn: 157062
* DumpSegment64Command() wasn't returning correct result. Caught by static ↵Evan Cheng2012-04-261-1/+1
| | | | | | analyzer. rdar://11329354 llvm-svn: 155669
* Teach macho-dump to dump the uleb128s referred to by linkedit_data segments.Benjamin Kramer2011-08-301-1/+10
| | | | llvm-svn: 138836
* Teach macho-dump how to dump linkedit_data load commands.Benjamin Kramer2011-08-301-0/+19
| | | | llvm-svn: 138807
* Remove unused function.Eric Christopher2011-04-041-21/+0
| | | | llvm-svn: 128834
* silence an unused function warning.Chris Lattner2011-04-041-0/+2
| | | | llvm-svn: 128831
* Start migrating mach-o dumping facilities to the object file out of aEric Christopher2011-04-031-2/+2
| | | | | | separate executable. llvm-svn: 128801
* MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer2010-12-161-4/+2
| | | | | | via an out parm. llvm-svn: 121958
* Mach-O: Tweak field name.Daniel Dunbar2010-12-101-1/+1
| | | | llvm-svn: 121465
* Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵Michael J. Spencer2010-12-091-2/+4
| | | | | | error_code &ec. And fix clients. llvm-svn: 121379
* macho-dump: Add support for --dump-section-data and tweak a few format strings.Daniel Dunbar2010-11-271-5/+19
| | | | llvm-svn: 120219
* macho-dump: Add support for dumping symbol table entries.Daniel Dunbar2010-11-271-1/+43
| | | | llvm-svn: 120218
* macho-dump: Add support for dumping string table data.Daniel Dunbar2010-11-271-0/+8
| | | | llvm-svn: 120217
* macho-dump: Add support for dumping relocation entries.Daniel Dunbar2010-11-271-19/+42
| | | | llvm-svn: 120216
* macho-dump: Add support for dumping sections.Daniel Dunbar2010-11-271-6/+72
| | | | llvm-svn: 120215
* macho-dump: Add support for dumping dysymtab indirect symbol table.Daniel Dunbar2010-11-271-1/+19
| | | | llvm-svn: 120214
* macho-dump: Add support for dumping symtab and dysymtab commands.Daniel Dunbar2010-11-271-0/+52
| | | | llvm-svn: 120204
* macho-dump: Add support for dumping segment load commands.Daniel Dunbar2010-11-271-3/+58
| | | | llvm-svn: 120203
* Object/Mach-O: Add header and load command information.Daniel Dunbar2010-11-271-12/+69
| | | | llvm-svn: 120198
* macho-dump: More sketching.Daniel Dunbar2010-11-271-2/+28
| | | | llvm-svn: 120192
* macho-dump: Stub out C++ macho-dump tool.Daniel Dunbar2010-11-271-0/+30
llvm-svn: 120191
OpenPOWER on IntegriCloud