summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump/MachODump.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* At Jim Grosbach's request detemplate Object/MachO.h.Rafael Espindola2013-04-181-26/+17
| | | | | | | We are still able to handle mixed endian objects by swapping one struct at a time. llvm-svn: 179778
* Finish templating MachObjectFile over endianness.Rafael Espindola2013-04-131-14/+34
| | | | | | | We are now able to handle big endian macho files in llvm-readobject. Thanks to David Fang for providing the object files. llvm-svn: 179440
* Simplify the code. No functionality change.Rafael Espindola2013-04-111-17/+1
| | | | llvm-svn: 179259
* Template the MachO types over endianness.Rafael Espindola2013-04-101-5/+6
| | | | | | For now they are still only used as little endian. llvm-svn: 179147
* Convert MachOObjectFile to a template.Rafael Espindola2013-04-091-4/+4
| | | | | | | For now it is templated only on being 64 or 32 bits. I will add little/big endian next. llvm-svn: 179097
* Implement MachOObjectFile::getHeader directly.Rafael Espindola2013-04-071-4/+4
| | | | llvm-svn: 178994
* Remove LoadCommandInfo now that we always have a pointer to the command.Rafael Espindola2013-04-071-3/+3
| | | | | | | LoadCommandInfo was needed to keep a command and its offset in the file. Now that we always have a pointer to the command, we don't need the offset. llvm-svn: 178991
* Add MachOObjectFile::LoadCommandInfo.Rafael Espindola2013-04-071-2/+2
| | | | | | This avoids using MachOObject::getLoadCommandInfo. llvm-svn: 178990
* Remove MachOObjectFile::getObject.Rafael Espindola2013-04-071-10/+8
| | | | llvm-svn: 178986
* Make getObject const. Remove a const_cast.Rafael Espindola2013-04-071-2/+2
| | | | llvm-svn: 178980
* Remove last use of InMemoryStruct in llvm-objdump.Rafael Espindola2013-04-071-2/+2
| | | | llvm-svn: 178979
* Remove dead code.Rafael Espindola2013-04-071-17/+0
| | | | llvm-svn: 178977
* Remove unused argument.Rafael Espindola2013-04-071-3/+1
| | | | llvm-svn: 178976
* Don't fetch pointers from a InMemoryStruct.Rafael Espindola2013-04-051-3/+2
| | | | | | | | InMemoryStruct is extremely dangerous as it returns data from an internal buffer when the endiannes doesn't match. This should fix the tests on big endian hosts. llvm-svn: 178875
* Add a function to get the segment name of a section.Rafael Espindola2012-12-211-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On MachO, sections also have segment names. When a tool looking at a .o file prints a segment name, this is what they mean. In reality, a .o has only one anonymous, segment. This patch adds a MachO only function to fetch that segment name. I named it getSectionFinalSegmentName since the main use for the name seems to be inform the linker with segment this section should go to. The patch also changes MachOObjectFile::getSectionName to return just the section name instead of computing SegmentName,SectionName. The main difference from the previous patch is that it doesn't use InMemoryStruct. It is extremely dangerous: if the endians match it returns a pointer to the file buffer, if not, it returns a pointer to an internal buffer that is overwritten in the next API call. We should change all of this code to use support::detail::packed_endian_specific_integral like ELF, but since these functions only handle strings, they work with big and little endian machines as is. I have tested this by installing ubuntu 12.10 ppc on qemu, that is why it took so long :-) llvm-svn: 170838
* Revert 170545 while I debug the ppc failures.Rafael Espindola2012-12-191-7/+1
| | | | llvm-svn: 170547
* Add r170095 back.Rafael Espindola2012-12-191-1/+7
| | | | | | | | | | | | | | | | | | | | | | | I cannot reproduce it the failures locally, so I will keep an eye at the ppc bots. This patch does add the change to the "Disassembly of section" message, but that is not what was failing on the bots. Original message: Add a funciton to get the segment name of a section. On MachO, sections also have segment names. When a tool looking at a .o file prints a segment name, this is what they mean. In reality, a .o has only one anonymous, segment. This patch adds a MachO only function to fetch that segment name. I named it getSectionFinalSegmentName since the main use for the name seems to be infor the linker with segment this section should go to. The patch also changes MachOObjectFile::getSectionName to return just the section name instead of computing SegmentName,SectionName. llvm-svn: 170545
* Revert "Add a funciton to get the segment name of a section."Eric Christopher2012-12-131-7/+1
| | | | | | This reverts commit r170095 since it appears to be breaking the bots. llvm-svn: 170105
* Add a funciton to get the segment name of a section.Rafael Espindola2012-12-131-1/+7
| | | | | | | | | | | | | | | On MachO, sections also have segment names. When a tool looking at a .o file prints a segment name, this is what they mean. In reality, a .o has only one, anonymous, segment. This patch adds a MachO only function to fetch that segment name. I named it getSectionFinalSegmentName since the main use for the name seems to be informing the linker with segment this section should go to. The patch also changes MachOObjectFile::getSectionName to return just the section name instead of computing SegmentName,SectionName. llvm-svn: 170095
* Sort the #include lines for tools/...Chandler Carruth2012-12-041-3/+3
| | | | | | | | Again, tools are trickier to pick the main module header for than library source files. I've started to follow the pattern of using LLVMContext.h when it is included as a stub for program source files. llvm-svn: 169252
* Rewrite DIContext interface to take an object. Update all callers.Eric Christopher2012-11-121-41/+4
| | | | llvm-svn: 167757
* Remove tabs.Bill Wendling2012-07-191-15/+13
| | | | llvm-svn: 160480
* Need a space.Evan Cheng2012-07-021-1/+1
| | | | llvm-svn: 159565
* Fixed a bug in llvm-objdump when disassembling using -macho option for a binaryKevin Enderby2012-05-181-2/+29
| | | | | | containing no symbols. Fixed the crash and fixed it not disassembling anything. llvm-svn: 157031
* Fixed a bug in llvm-objdump when disassembling using -macho option for a binaryKevin Enderby2012-05-151-1/+1
| | | | | | | that has more than one symbol. The last symbol was not being disassembled to the end of the section. llvm-svn: 156840
* Make MCInstrInfo available to the MCInstPrinter. This will be used to remove ↵Craig Topper2012-04-021-2/+3
| | | | | | getInstructionName and the static data it contains since the same tables are already in MCInstrInfo. llvm-svn: 153860
* Make MCRegisterInfo available to the the MCInstPrinter.Jim Grosbach2012-03-051-1/+3
| | | | | | | Used to allow context sensitive printing of super-register or sub-register references. llvm-svn: 152043
* Allow command-line overrides of the target triple with the Mach-OCameron Zwarich2012-02-031-19/+20
| | | | | | disassembler, just like the generic disassembler. llvm-svn: 149681
* Do the same fix as r149667, but for the Mach-O disassembler.Cameron Zwarich2012-02-031-0/+4
| | | | llvm-svn: 149674
* Fixed ObjectFile functions:Danil Malyshev2011-11-291-2/+2
| | | | | | | | | | | - getSymbolOffset() renamed as getSymbolFileOffset() - getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile. - added getRelocationOffset() - fixed MachOObjectFile::getSymbolSize() - fixed MachOObjectFile::getSymbolSection() - fixed MachOObjectFile::getSymbolOffset() for symbols without section data. llvm-svn: 145408
* Revert r145180 as it is causing test failures on all the bots.Chandler Carruth2011-11-271-2/+2
| | | | | | | | | | | | | Original commit message: Fixed ObjectFile functions: - getSymbolOffset() renamed as getSymbolFileOffset() - getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile. - added getRelocationOffset() - fixed MachOObjectFile::getSymbolSize() - fixed MachOObjectFile::getSymbolSection() - fixed MachOObjectFile::getSymbolOffset() for symbols without section data. llvm-svn: 145182
* Fixed ObjectFile functions:Danil Malyshev2011-11-271-2/+2
| | | | | | | | | | | - getSymbolOffset() renamed as getSymbolFileOffset() - getSymbolFileOffset(), getSymbolAddress(), getRelocationAddress() returns same result for ELFObjectFile, MachOObjectFile and COFFObjectFile. - added getRelocationOffset() - fixed MachOObjectFile::getSymbolSize() - fixed MachOObjectFile::getSymbolSection() - fixed MachOObjectFile::getSymbolOffset() for symbols without section data. llvm-svn: 145180
* Fix llvm-objdump's MachO mode to not depend on the value returned by ↵Owen Anderson2011-11-071-6/+6
| | | | | | RelocationRef::getInfo(). llvm-svn: 143966
* Add more PRI.64 macros for MSVC and use them throughout the codebase.Benjamin Kramer2011-11-051-2/+2
| | | | llvm-svn: 143799
* Expand relocation type field to 64 bits. MachO scattered relocations ↵Owen Anderson2011-10-261-1/+1
| | | | | | require 33 bits of type info. llvm-svn: 143032
* Rewrite most of MachODump to work through the generic libObject interfaces ↵Owen Anderson2011-10-171-169/+183
| | | | | | rather than accessing the MachO internals directly. llvm-svn: 142263
* llvm-objdump: Take ownership of MCInstrInfos.Benjamin Kramer2011-10-101-2/+2
| | | | llvm-svn: 141535
* Fix spelling in comment.Michael J. Spencer2011-10-071-3/+3
| | | | llvm-svn: 141386
* Revert 141376 and 141377 due to breaking the build.Bill Wendling2011-10-071-3/+3
| | | | | | | | | | | | | | | | --- Reverse-merging r141377 into '.': U tools/llvm-objdump/MachODump.cpp --- Reverse-merging r141376 into '.': U include/llvm/Object/COFF.h U include/llvm/Object/ObjectFile.h U include/llvm-c/Object.h U tools/llvm-objdump/llvm-objdump.cpp U lib/Object/MachOObjectFile.cpp U lib/Object/COFFObjectFile.cpp U lib/Object/Object.cpp U lib/Object/ELFObjectFile.cpp llvm-svn: 141379
* Fix spelling in comment.Michael J. Spencer2011-10-071-3/+3
| | | | llvm-svn: 141377
* llvm-objdump: Detach symbol listing from section enumeration for mach-o.Benjamin Kramer2011-09-211-19/+16
| | | | | | This reduces memory usage as we don't add the same symbol multiple times anymore. llvm-svn: 140278
* llvm-objdump: Take the data from the right object when there's no dSYM around.Benjamin Kramer2011-09-211-11/+13
| | | | llvm-svn: 140269
* llvm-objdump: Fix use after free.Benjamin Kramer2011-09-211-1/+1
| | | | llvm-svn: 140237
* llvm-objdump: Output line info next to the disassembly if available.Benjamin Kramer2011-09-211-52/+153
| | | | | | | | | | | | MachO-only at the moment, sorry. Usage: $ llvm-objdump -d -m -g -dsym=a.out.dSYM/Contents/Resources/DWARF/a.out a.out _main: 100000e90: 55 pushq %rbp ## test.c:11:3 … llvm-svn: 140224
* llvm-objdump: factor code better, add comments.Benjamin Kramer2011-09-201-137/+165
| | | | llvm-svn: 140153
* Nope, there's another one!Benjamin Kramer2011-09-191-1/+1
| | | | llvm-svn: 140045
* Missed one instance of implicit pointer conversion.Benjamin Kramer2011-09-191-1/+1
| | | | llvm-svn: 140044
* Try to make MSVC 2010 happy.Benjamin Kramer2011-09-191-2/+2
| | | | llvm-svn: 140042
* Add a MachO-specific "mode" to llvm-objdump, that, if enabled, gathers ↵Benjamin Kramer2011-09-191-0/+489
additional information that are only available on MachO. - It can take FunctionStarts from a binary to find entry points more accurately. - Symbol offsets in executables are correct now. llvm-svn: 140028
OpenPOWER on IntegriCloud