summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't return error_code from a function that doesn't fail.Rafael Espindola2015-06-301-3/+2
| | | | llvm-svn: 241042
* Move function to the only file that uses it.Rafael Espindola2015-06-301-2/+35
| | | | llvm-svn: 241040
* Don't return error_code from a function that doesn't fail.Rafael Espindola2015-06-301-5/+2
| | | | llvm-svn: 241039
* Don't return error_code from function that never fails.Rafael Espindola2015-06-293-29/+14
| | | | llvm-svn: 241021
* Convert obj->getSymbolName to sym->getName.Rafael Espindola2015-06-291-1/+1
| | | | | | I doesn't depend on the object anymore. llvm-svn: 240996
* Factor out the checking of string tables.Rafael Espindola2015-06-291-1/+5
| | | | | | | | | | This moves the error checking for string tables to getStringTable which returns an ErrorOr<StringRef>. This improves error checking, makes it uniform across all string tables and makes it possible to check them once instead of once per name. llvm-svn: 240950
* Remove Elf_Sym_Iter.Rafael Espindola2015-06-291-2/+5
| | | | | | | | | | | | | | | | | | | It was a fairly broken concept for an ELF only class. An ELF file can have two symbol tables, but they have exactly the same format. There is no concept of a dynamic or a static symbol. Storing this on the iterator also makes us do more work per symbol than necessary. To fetch a name we would: * Find if we had a static or a dynamic symbol. * Look at the corresponding symbol table and find the string table section. * Look at the string table section to fetch its contents. * Compute the name as a substring of the string table. All but the last step can be done per symbol table instead of per symbol. This is a step in that direction. llvm-svn: 240939
* Rename getObjectFile to getObject for consistency.Rafael Espindola2015-06-262-4/+4
| | | | llvm-svn: 240785
* Simplify getSymbolType.Rafael Espindola2015-06-262-14/+7
| | | | | | | | This is still a really odd function. Most calls are in object format specific contexts and should probably be replaced with a more direct query, but at least now this is not too obnoxious to use. llvm-svn: 240777
* Add an ELFSymbolRef type.Rafael Espindola2015-06-251-2/+2
| | | | | | | This allows user code to say Sym.getSize() instead of having to manually fetch the object. llvm-svn: 240708
* Change how symbol sizes are handled in lib/Object.Rafael Espindola2015-06-242-10/+10
| | | | | | | | | | | | | | COFF and MachO only define symbol sizes for common symbols. Reflect that in the class hierarchy by having a method for common symbols only in the base and a general one in ELF. This avoids the need of using a magic value for the size, which had a few problems * Most callers didn't check for it. * The ones that did could not tell the magic value from a file actually having that value. llvm-svn: 240529
* Revert "[FaultMaps] Move FaultMapParser to Object/"Sanjoy Das2015-06-231-1/+1
| | | | | | | This reverts commit r240364 (git c49542e5bb186). The issue r240364 was trying to fix was fixed independently in r240362. llvm-svn: 240448
* Don't pass a 32 bit value to "%08" PRIx64.Rafael Espindola2015-06-231-4/+4
| | | | | | Should fix the arm bots. llvm-svn: 240439
* objdump: Don't print a (always 0) size for MachO symbols.Rafael Espindola2015-06-231-10/+10
| | | | | | | | | | | Only common symbol on MachO and COFF have a size. For COFF we already had a custom format. For MachO, there is no native objdump and we were printing it as ELF. Now we only print the sizes for symbols that actually have them. llvm-svn: 240422
* [FaultMaps] Move FaultMapParser to Object/Sanjoy Das2015-06-231-1/+1
| | | | | | | | | | | | | | | | | | Summary: That way llvm-objdump can rely on it without adding an extra dependency on CodeGen. This change duplicates the FaultKind enum and the code that serializes it to a string. I could not figure out a way to get around this without adding a new dependency to Object Reviewers: rafael, ab Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10619 llvm-svn: 240364
* llvm/tools/llvm-objdump/CMakeLists.txt: Update libdeps to fix r240304.NAKAMURA Takumi2015-06-231-0/+1
| | | | llvm-svn: 240362
* [FaultMaps] Add a parser for the __llvm__faultmaps section.Sanjoy Das2015-06-221-1/+52
| | | | | | | | | | | | | | | Summary: The parser is exercised by llvm-objdump using -print-fault-maps. As is probably obvious, the code itself was "heavily inspired" by http://reviews.llvm.org/D10434. Reviewers: reames, atrick, JosephTremoulet Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10491 llvm-svn: 240304
* Fix "the the" in comments.Eric Christopher2015-06-191-1/+1
| | | | llvm-svn: 240112
* Remove object_error::success and use std::error_code() insteadRui Ueyama2015-06-092-8/+8
| | | | | | | | | | | | make_error_code(object_error) is slow because object::object_category() uses a ManagedStatic variable. But the real problem is that the function is called too frequently. This patch uses std::error_code() instead of object_error::success. In most cases, we return "success", so this patch reduces number of function calls to that function. http://reviews.llvm.org/D10333 llvm-svn: 239409
* [objdump] Moving PrintImmHex out of MachODump and in to llvm-objdump and ↵Colin LeMahieu2015-06-073-4/+6
| | | | | | setting instprinter appropriately. llvm-svn: 239265
* llvm-objdump: return non-zero exit code for certain cases of invalid inputAlexey Samsonov2015-06-041-7/+12
| | | | | | | | * If the input file is missing; * If the type of input object file can't be recognized; * If the object file can't be parsed correctly. llvm-svn: 239065
* Disassemble the start of sections even if there is no symbol there.Rafael Espindola2015-06-041-5/+3
| | | | | | | We already handled a section with no symbols, extend that to also handle a section with symbols that don't include the section start. llvm-svn: 239039
* [Object, MachO] Introduce MachOObjectFile::load_commands() range iterator.Alexey Samsonov2015-06-031-65/+18
| | | | | | | | | | | | | | | | | | 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
* Fix the interpretation of a 0 st_name.Rafael Espindola2015-06-031-11/+24
| | | | | | | | | | | | | | The ELF spec is very clear: ----------------------------------------------------------------------------- If the value is non-zero, it represents a string table index that gives the symbol name. Otherwise, the symbol table entry has no name. -------------------------------------------------------------------------- In particular, a st_name of 0 most certainly doesn't mean that the symbol has the same name as the section. llvm-svn: 238899
* Move to llvm-objdump a large amount of code to that is only used there.Rafael Espindola2015-06-031-3/+382
| | | | llvm-svn: 238898
* Simplify another function that doesn't fail.Rafael Espindola2015-06-011-3/+1
| | | | llvm-svn: 238703
* Simplify interface of function that doesn't fail.Rafael Espindola2015-05-311-3/+1
| | | | llvm-svn: 238700
* [Objdump] Removing unused parameter.Colin LeMahieu2015-05-291-2/+2
| | | | llvm-svn: 238557
* [Hexagon] Disassembling, printing, and emitting instructions a whole-bundle ↵Colin LeMahieu2015-05-291-3/+61
| | | | | | at a time which is the semantic unit for Hexagon. Fixing tests to use the new format. Disabling tests in the direct object emission path for a followup patch. llvm-svn: 238556
* Removing a switch statement that only contains a default; NFC.Aaron Ballman2015-05-291-4/+1
| | | | llvm-svn: 238552
* [llvm] Adding vdtor to fix warning.Colin LeMahieu2015-05-281-0/+1
| | | | llvm-svn: 238494
* [Objdump] Allow instruction pretty printing to be specialized by the target ↵Colin LeMahieu2015-05-281-6/+28
| | | | | | | | triple. Differential Revision: http://reviews.llvm.org/D8427 llvm-svn: 238457
* [llvm] Parameterizing the output stream for dumpbytes and outputting ↵Colin LeMahieu2015-05-283-23/+9
| | | | | | directly to stream. llvm-svn: 238453
* Make it easier to use DwarfContext with MCJITKeno Fischer2015-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This supersedes http://reviews.llvm.org/D4010, hopefully properly dealing with the JIT case and also adds an actual test case. DwarfContext was basically already usable for the JIT (and back when we were overwriting ELF files it actually worked out of the box by accident), but in order to resolve relocations correctly it needs to know the load address of the section. Rather than trying to get this out of the ObjectFile or requiring the user to create a new ObjectFile just to get some debug info, this adds the capability to pass in that info directly. As part of this I separated out part of the LoadedObjectInfo struct from RuntimeDyld, since it is now required at a higher layer. Reviewers: lhames, echristo Reviewed By: echristo Subscribers: vtjnash, friss, rafael, llvm-commits Differential Revision: http://reviews.llvm.org/D6961 llvm-svn: 237961
* [Object] Teach Object and llvm-objdump about ".hidden"Davide Italiano2015-04-301-2/+6
| | | | | | | Differential Revision: http://reviews.llvm.org/D9416 Reviewed by: rafael llvm-svn: 236279
* For llvm-objdump, with the -archive-headers and -macho options, use the ↵Kevin Enderby2015-04-301-4/+10
| | | | | | | | | | -non-verbose option to print the archive headers using raw numeric values. Also add the -archive-member-offsets for use with these to also trigger printing of the offset of the archive member from the start of the archive. llvm-svn: 236252
* Move DIContext.h to common DebugInfo location.Zachary Turner2015-04-231-2/+3
| | | | | | | | | | This will enable us to create a PDBContext so as to expose some amount of debug info functionality through a common interace. Differential Revision: http://reviews.llvm.org/D9205 Reviewed by: Alexey Samsonov llvm-svn: 235612
* For llvm-objdump, dump the (__OBJC,__protocol) section for Objc1 32-bit ↵Kevin Enderby2015-04-161-0/+52
| | | | | | | | Mach-O files with the -section option as objc_protocol_t structs. llvm-svn: 235141
* [NFC] [MachO] remove extra semicolonsJingyue Wu2015-04-161-4/+4
| | | | llvm-svn: 235130
* For llvm-objdump added support for printing Objc1 32-bit runtime meta dataKevin Enderby2015-04-161-11/+836
| | | | | | with the existing -objc-meta-data and -macho options for Mach-O files. llvm-svn: 235119
* Fix failure on builder clang-cmake-mips where it was printing a 32-bit addressKevin Enderby2015-04-061-1/+2
| | | | | | | incorrectly because it came from an expression using S.getAddress() which always returns a 64-bit value. llvm-svn: 234251
* For llvm-objdump added support for printing Objc2 32-bit runtime meta dataKevin Enderby2015-04-061-20/+887
| | | | | | with the existing -objc-meta-data and -macho options for Mach-O files. llvm-svn: 234185
* Fix sanitizer-x86_64-linux-fast failure that was not deleting the bindtable.Kevin Enderby2015-04-011-0/+3
| | | | llvm-svn: 233856
* Add the option -objc-meta-data to llvm-objdump used with -macho toKevin Enderby2015-04-013-12/+1230
| | | | | | | | | | print the Objective-C runtime meta data for Mach-O files. There are three types of Objective-C runtime meta data, Objc2 64-bit, Objc2 32-bit and Objc1 32-bit. This prints the first of these types. The changes to print the others will follow next. llvm-svn: 233840
* Replace the MCSubtargetInfo parameter with a Triple when creatingEric Christopher2015-03-312-4/+4
| | | | | | | an MCInstPrinter. Update all callers and use where we wanted a Triple previously. llvm-svn: 233648
* [Objdump] Pass the correct subtarget to printInst.Akira Hatanaka2015-03-281-2/+2
| | | | | | This fixes a bug I introduced in r233411. llvm-svn: 233484
* [MCInstPrinter] Enable MCInstPrinter to change its behavior based on theAkira Hatanaka2015-03-272-4/+4
| | | | | | | | | | | | | | | | | | | | per-function subtarget. Currently, code-gen passes the default or generic subtarget to the constructors of MCInstPrinter subclasses (see LLVMTargetMachine::addPassesToEmitFile), which enables some targets (AArch64, ARM, and X86) to change their instprinter's behavior based on the subtarget feature bits. Since the backend can now use different subtargets for each function, instprinter has to be changed to use the per-function subtarget rather than the default subtarget. This patch takes the first step towards enabling instprinter to change its behavior based on the per-function subtarget. It adds a bit "PassSubtarget" to AsmWriter which tells table-gen to pass a reference to MCSubtargetInfo to the various print methods table-gen auto-generates. I will follow up with changes to instprinters of AArch64, ARM, and X86. llvm-svn: 233411
* Add a -raw option to the -section mode of llvm-objdump.Adrian Prantl2015-03-272-3/+14
| | | | llvm-svn: 233390
* Refactor: simplify boolean expressions in llvm-objdumpDavid Blaikie2015-03-231-235/+224
| | | | | | | | | | | | | | | | Simplify boolean expressions involving `true` and `false` with `clang-tidy`. Actually upon inspection a bunch of these boolean variables could be factored away entirely anyway - using find_if and then testing the result before using it. This also helps reduce indentation in the code anyway - and a bunch of other related simplification fell out nearby so I just committed all of that. Patch by Richard Thomson (legalize@xmission.com) Differential Revision: http://reviews.llvm.org/D8517 llvm-svn: 232984
* [Objdump] DumpBytes of uint8_t from ArrayRef<uint8_t> instead of char from ↵Colin LeMahieu2015-03-183-19/+13
| | | | | | StringRef. Removing reinterpret_casts. llvm-svn: 232659
OpenPOWER on IntegriCloud