summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/MachODumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement MachODumper::printFileHeadersFrederic Riss2014-11-171-1/+175
| | | | | | | | Patch by Chilledheart. Differential Revision: http://reviews.llvm.org/D6163 llvm-svn: 222115
* Remove bogus std::error_code returns form SectionRef.Rafael Espindola2014-10-081-5/+2
| | | | | | | | | | | | | | 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
* Object: BSS/virtual sections don't have contentsDavid Majnemer2014-09-261-3/+8
| | | | | | | | | | | | Users of getSectionContents shouldn't try to pass in BSS or virtual sections. In all instances, this is a bug in the code calling this routine. N.B. Some COFF implementations (like CL) will mark their BSS sections as taking space on disk. This would confuse COFFObjectFile into thinking the section is larger than the file. llvm-svn: 218549
* Remove 'virtual' keyword from methods markedwith 'override' keyword.Craig Topper2014-08-301-6/+6
| | | | llvm-svn: 216823
* llvm-readobj: fix MachO relocatoin printing a bit.Tim Northover2014-07-041-6/+18
| | | | | | | | | | | | | | | | There were two issues here: 1. At the very least, scattered relocations cannot use the same code to determine the corresponding symbol being referred to. For some reason we pretend there is no symbol, even when one actually exists in the symtab, so to match this behaviour getRelocationSymbol should simply return symbols_end for scattered relocations. 2. Printing "-" when we can't get a symbol (including the scattered case, but not exclusively), isn't that helpful. In both cases there *is* interesting information in that field, so we should print it. As hex will do. Small part of rdar://problem/17553104 llvm-svn: 212332
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-131-5/+4
| | | | llvm-svn: 210876
* Remove all uses of 'using std::error_code' from headers.Rafael Espindola2014-06-131-0/+1
| | | | llvm-svn: 210866
* [C++11] Introduce ObjectFile::symbols() to use range-based loops.Alexey Samsonov2014-03-171-27/+24
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3081 llvm-svn: 204031
* [C++11] Introduce SectionRef::relocations() to use range-based loopsAlexey Samsonov2014-03-141-19/+16
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3077 llvm-svn: 203927
* [C++11] Use ObjectFile::sections() in commandline llvm toolsAlexey Samsonov2014-03-131-41/+34
| | | | llvm-svn: 203802
* Fix warning about mismatched signs in comparison.Rafael Espindola2014-03-061-1/+1
| | | | llvm-svn: 203155
* Fix the printing of n_type.Rafael Espindola2014-03-061-4/+7
| | | | | | | Despite the name, n_type contains the type of the symbol, but also if it is extern or private extern. llvm-svn: 203154
* Use the existing N_STAB from the MachO namespace.Rafael Espindola2014-03-061-5/+1
| | | | llvm-svn: 203152
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-2/+2
| | | | | | | | | | 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
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-021-6/+6
| | | | llvm-svn: 202621
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-101-14/+14
| | | | llvm-svn: 201108
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-301-23/+7
| | | | | | | | | | | | 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
* Re-sort #include lines again, prior to moving headers around.Chandler Carruth2014-01-131-1/+0
| | | | llvm-svn: 199080
* Remove several unused variables.Rafael Espindola2013-10-011-2/+0
| | | | | | Patch by Alp Toker. llvm-svn: 191757
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-09-011-33/+33
| | | | llvm-svn: 189728
* Revert "Fix the build broken by r189315." and "Move everything depending on ↵Charles Davis2013-08-271-33/+33
| | | | | | | | | 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
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-08-271-33/+33
| | | | llvm-svn: 189315
* Handle relocations that don't point to symbols.Rafael Espindola2013-06-051-4/+3
| | | | | | | | In ELF (as in MachO), not all relocations point to symbols. Represent this properly by using a symbol_iterator instead of a SymbolRef. Update llvm-readobj ELF's dumper to handle relocatios without symbols. llvm-svn: 183284
* Use pointers to iterate over symbols.Rafael Espindola2013-04-241-1/+3
| | | | | | | | While here, don't report a dummy symbol for relocations that don't have symbols. We used to says such relocations were for the first defined symbol, but now we return end_symbols(). The llvm-readobj output change agrees with otool. llvm-svn: 180214
* llvm-readobj: Do not print NULL StringRefsNico Rieck2013-04-221-5/+4
| | | | llvm-svn: 180005
* At Jim Grosbach's request detemplate Object/MachO.h.Rafael Espindola2013-04-181-75/+58
| | | | | | | We are still able to handle mixed endian objects by swapping one struct at a time. llvm-svn: 179778
* Remove getters now that we can specialize structs on the host endianness.Rafael Espindola2013-04-151-3/+3
| | | | llvm-svn: 179534
* Finish templating MachObjectFile over endianness.Rafael Espindola2013-04-131-52/+80
| | | | | | | 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
* Add -expand-relocs to llvm-readobjNico Rieck2013-04-121-12/+26
| | | | | | | | | | | | | | This option expands shown relocations from single line to a dictionary format: Relocation { Offset: 0x4 Type: R_386_32 (1) Symbol: sym Info: 0x0 } llvm-svn: 179359
* Add 179294 back, but don't use bit fields so that it works on big endian hosts.Rafael Espindola2013-04-121-4/+12
| | | | | | | | | | | | | | Original message: Print more information about relocations. With this patch llvm-readobj now prints if a relocation is pcrel, its length, if it is extern and if it is scattered. It also refactors the code a bit to use bit fields instead of shifts and masks all over the place. llvm-svn: 179345
* Revert my last two commits while I debug what is wrong in a big endian host.Rafael Espindola2013-04-111-12/+4
| | | | llvm-svn: 179303
* Print more information about relocations.Rafael Espindola2013-04-111-4/+12
| | | | | | | | | | With this patch llvm-readobj now prints if a relocation is pcrel, its length, if it is extern and if it is scattered. It also refactors the code a bit to use bit fields instead of shifts and masks all over the place. llvm-svn: 179294
* Template MachOObjectFile over endianness too.Rafael Espindola2013-04-101-8/+8
| | | | llvm-svn: 179179
* Convert MachOObjectFile to a template.Rafael Espindola2013-04-091-13/+15
| | | | | | | For now it is templated only on being 64 or 32 bits. I will add little/big endian next. llvm-svn: 179097
* Template the MachO types over the word size.Rafael Espindola2013-04-081-5/+6
| | | | llvm-svn: 179051
* Remove two uses of getObject.Rafael Espindola2013-04-071-13/+2
| | | | llvm-svn: 178985
* Remove usage of InMemoryStruct in getSymbol.Rafael Espindola2013-04-071-26/+6
| | | | llvm-svn: 178984
* Remove a use of InMemoryStruct in llvm-readobj.Rafael Espindola2013-04-071-9/+6
| | | | llvm-svn: 178981
* Make getObject const. Remove a const_cast.Rafael Espindola2013-04-071-1/+1
| | | | llvm-svn: 178980
* Don't fetch pointers from a InMemoryStruct.Rafael Espindola2013-04-051-15/+8
| | | | | | | | 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
* Implements low-level object file format specific output for COFF andEric Christopher2013-04-031-0/+438
ELF with support for: - File headers - Section headers + data - Relocations - Symbols - Unwind data (only COFF/Win64) The output format follows a few rules: - Values are almost always output one per line (as elf-dump/coff-dump already do). - Many values are translated to something readable (like enum names), with the raw value in parentheses. - Hex numbers are output in uppercase, prefixed with "0x". - Flags are sorted alphabetically. - Lists and groups are always delimited. Example output: ---------- snip ---------- Sections [ Section { Index: 1 Name: .text (5) Type: SHT_PROGBITS (0x1) Flags [ (0x6) SHF_ALLOC (0x2) SHF_EXECINSTR (0x4) ] Address: 0x0 Offset: 0x40 Size: 33 Link: 0 Info: 0 AddressAlignment: 16 EntrySize: 0 Relocations [ 0x6 R_386_32 .rodata.str1.1 0x0 0xB R_386_PC32 puts 0x0 0x12 R_386_32 .rodata.str1.1 0x0 0x17 R_386_PC32 puts 0x0 ] SectionData ( 0000: 83EC04C7 04240000 0000E8FC FFFFFFC7 |.....$..........| 0010: 04240600 0000E8FC FFFFFF31 C083C404 |.$.........1....| 0020: C3 |.| ) } ] ---------- snip ---------- Relocations and symbols can be output standalone or together with the section header as displayed in the example. This feature set supports all tests in test/MC/COFF and test/MC/ELF (and I suspect all additional tests using elf-dump), making elf-dump and coff-dump deprecated. Patch by Nico Rieck! llvm-svn: 178679
OpenPOWER on IntegriCloud