summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump
Commit message (Collapse)AuthorAgeFilesLines
...
* [C++11] Introduce ObjectFile::symbols() to use range-based loops.Alexey Samsonov2014-03-172-25/+25
| | | | | | | | | | | | 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-143-26/+21
| | | | | | | | | | | | 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-132-47/+49
| | | | llvm-svn: 203802
* Change MCDisassembler::setSymbolizer to take unique_ptr by value.Ahmed Charles2014-03-071-1/+1
| | | | | | | This changes the interface to be more explicit that ownership is being transferred. llvm-svn: 203223
* Support: split object format out of environmentSaleem Abdulrasool2014-03-061-1/+1
| | | | | | | | | | | This is a preliminary setup change to support a renaming of Windows target triples. Split the object file format information out of the environment into a separate entity. Unfortunately, file format was previously treated as an environment with an unknown OS. This is most obvious in the ARM subtarget where the handling for macho on an arbitrary platform switches to AAPCS rather than APCS (as per Apple's needs). llvm-svn: 203160
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-062-38/+38
| | | | | | | | | | 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
* Attempt to unbreak little-endian buildbots.Rui Ueyama2014-03-051-3/+6
| | | | llvm-svn: 203023
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-051-2/+2
| | | | llvm-svn: 202957
* llvm-objdump: Indent unwind info contents.Rui Ueyama2014-03-041-11/+11
| | | | | | | | | | | Unwind info contents were indented at the same level as function table contents. That's a bit confusing because the unwind info is pointed by function table. In other places we usually increment indentation depth by one when dereferncing a pointer. This patch also removes extraneous newlines between function tables. llvm-svn: 202879
* llvm-objdump: Fix typo in output.Rui Ueyama2014-03-041-1/+1
| | | | llvm-svn: 202875
* Fix typo.Rui Ueyama2014-03-041-3/+3
| | | | llvm-svn: 202787
* Use auto for readability.Rui Ueyama2014-03-041-5/+3
| | | | llvm-svn: 202786
* llvm-objdump: Print x64 unwind info in executable.Rui Ueyama2014-03-041-4/+33
| | | | | | | | | | | | | | | | | | The original code does not work correctly on executable files because the code is written in such a way that only object files are assumed to be given to llvm-objdump. Contents of RuntimeFunction are different between executables and objects. In executables, fields in RuntimeFunction have actual addresses to unwind info structures. On the other hand, in object files, the fields have zero value, but instead there are relocations pointing to the fields, so that Linker will fill them at link-time. So, when we are reading an object file, we need to use relocation info to find the location of unwind info. When executable, we should just look at the values in RuntimeFunction. llvm-svn: 202785
* llvm-objdump: Split printRuntimeFunction to two small functions.Rui Ueyama2014-03-041-39/+41
| | | | | | No functionality change. llvm-svn: 202781
* llvm-objdump: Split printCOFFUnwindInfo into small functions.Rui Ueyama2014-03-041-105/+123
| | | | llvm-svn: 202772
* llvm-objdump: Use range-based-for loop and fix format.Rui Ueyama2014-03-041-14/+18
| | | | | | This is a small cleanup before making a bit larger change to this function. llvm-svn: 202770
* llvm-objdump: Fix crash bug with printing unwind info on stripped file.Rui Ueyama2014-02-281-7/+9
| | | | | | | | | | | The current COFF unwind printer tries to print SEH handler function names, assuming that it can always find function names in string table. It crashes if file being read has no symbol table (i.e. executable). With this patch, llvm-objdump prints SEH handler's RVA if there's no symbol table entry for that RVA. llvm-svn: 202466
* Style fix.Rui Ueyama2014-02-281-1/+2
| | | | llvm-svn: 202465
* Remove unnecessary temporary variable.Rui Ueyama2014-02-281-4/+2
| | | | llvm-svn: 202445
* llvm-objdump: Do not attempt to disassemble symbols outside of sectionSimon Atanasyan2014-02-241-3/+6
| | | | | | | | | | | | | | boundaries. It is possible to create an ELF executable where symbol from say .text section 'points' to the address outside the section boundaries. It does not have a sense to disassemble something outside the section. Without this fix llvm-objdump prints finite or infinite (depends on the executable file architecture) number of 'invalid instruction encoding' warnings. llvm-svn: 202083
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-241-2/+2
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) llvm-svn: 202052
* Don't make F_None the default.Rafael Espindola2014-02-241-2/+2
| | | | | | This will make it easier to switch the default to being binary files. llvm-svn: 202042
* llvm-objdump/COFF: LoadConfiguration does not exist in object file.Rui Ueyama2014-02-211-0/+7
| | | | llvm-svn: 201883
* llvm-objdump/COFF: Print SEH table addresses.Rui Ueyama2014-02-201-0/+22
| | | | | | | SEH table addresses are VA in COFF file. In this patch we convert VA to RVA before printing it, because dumpbin prints them as RVAs. llvm-svn: 201760
* llvm-objdump/COFF: Print load configuration table.Rui Ueyama2014-02-191-0/+41
| | | | | | | | | | | | Load Configuration Table may contain a pointer to SEH table. This patch is to print the offset to the table. Printing SEH table contents is a TODO. The layout of Layout Configuration Table is described in Microsoft PE/COFF Object File Format Spec, but the table's offset/size descriptions seems to be totally wrong, at least in revision 8.3 of the spec. I believe the table in this patch is the correct one. llvm-svn: 201638
* Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola2014-02-103-25/+25
| | | | llvm-svn: 201108
* Simplify getSymbolFlags.Rafael Espindola2014-01-311-2/+1
| | | | | | | None of the object formats require extra parsing to compute these flags, so the method cannot fail. llvm-svn: 200574
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-303-55/+21
| | | | | | | | | | | | 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
* Fix "llvm-objdump -d -r" to show relocations inline for ELF filesMark Seaborn2014-01-251-6/+23
| | | | | | | | | | | | | | | | | | | This fixes a regression introduced by r182908, which broke llvm-objdump's ability to display relocations inline in a disassembly dump for ELF object files. That change removed a SectionRelocMap from Object/ELF.h, which we recreate in llvm-objdump.cpp. I discovered this regression via an out-of-tree test (test/NaCl/X86/pnacl-hides-sandbox-x86-64.ll) which used llvm-objdump. Note that the "Unknown" string in the test output on i386 isn't quite right, but this appears to be a pre-existing bug. Differential Revision: http://llvm-reviews.chandlerc.com/D2559 llvm-svn: 200090
* llvm-objdump: Some style cleanups to follow LLVM coding styleMark Seaborn2014-01-251-56/+69
| | | | | | | | | | | | Rename "ec" to "EC", and rename some iterators. Then fix whitespace using clang-format-diff. (As requested in http://llvm-reviews.chandlerc.com/D2559) Differential Revision: http://llvm-reviews.chandlerc.com/D2594 llvm-svn: 200053
* Fix known typosAlp Toker2014-01-241-1/+1
| | | | | | | Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. llvm-svn: 200018
* Be a bit more consistent about using ErrorOr when constructing Binary objects.Rafael Espindola2014-01-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | The constructors of classes deriving from Binary normally take an error_code as an argument to the constructor. My original intent was to change them to have a trivial constructor and move the initial parsing logic to a static method returning an ErrorOr. I changed my mind because: * A constructor with an error_code out parameter is extremely convenient from the implementation side. We can incrementally construct the object and give up when we find an error. * It is very efficient when constructing on the stack or when there is no error. The only inefficient case is where heap allocating and an error is found (we have to free the memory). The result is that this is a much smaller patch. It just standardizes the create* helpers to return an ErrorOr. Almost no functionality change: The only difference is that this found that we were trying to read past the end of COFF import library but ignoring the error. llvm-svn: 199770
* Rename these methods to match the style guide.Rafael Espindola2014-01-211-2/+2
| | | | llvm-svn: 199751
* llvm-objdump/COFF: Print ordinal base number.Rui Ueyama2014-01-171-0/+4
| | | | llvm-svn: 199518
* Fix style issues.Rui Ueyama2014-01-161-24/+30
| | | | llvm-svn: 199423
* llvm-objdump/COFF: Print DLL name in the export table header.Rui Ueyama2014-01-161-1/+5
| | | | llvm-svn: 199422
* llmv-objdump/COFF: Print export table contents.Rui Ueyama2014-01-161-1/+33
| | | | | | | | | | | | | | | | This patch adds the capability to dump export table contents. An example output is this: Export Table: Ordinal RVA Name 5 0x2008 exportfn1 6 0x2010 exportfn2 By adding this feature to llvm-objdump, we will be able to use it to check export table contents in LLD's tests. Currently we are doing binary comparison in the tests, which is fragile and not readable to humans. llvm-svn: 199358
* llvm-objdump: Don't print "Import table:" header if there's no import table.Rui Ueyama2014-01-151-3/+5
| | | | | | | | If a binary does not depend on any DLL, it does not contain import table at all. Printing the section title without contents looks wrong, so we shouldn't print it in that case. llvm-svn: 199340
* Return an ErrorOr<Binary *> from createBinary.Rafael Espindola2014-01-151-3/+4
| | | | | | | | 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
* [CMake] Update LLVM_LINK_COMPONENTS for each CMakeLists.txt.NAKAMURA Takumi2013-12-101-2/+1
| | | | llvm-svn: 196908
* Remove several unused variables.Rafael Espindola2013-10-011-2/+0
| | | | | | Patch by Alp Toker. llvm-svn: 191757
* 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
* Re-submit r191472 with a fix for big endian.Rui Ueyama2013-09-273-3/+58
| | | | | llvm-objdump: Dump COFF import table if -private-headers option is given. llvm-svn: 191557
* Revert "llvm-objdump: Dump COFF import table if -private-headers option is ↵Rui Ueyama2013-09-273-58/+3
| | | | | | | | given." This reverts commit r191472 because it's failing on BE machine. llvm-svn: 191480
* Fix another -Wnon-pod-varargs error in r191472.Rui Ueyama2013-09-271-1/+1
| | | | llvm-svn: 191474
* Fix -Wnon-pod-varargs error in r191472.Rui Ueyama2013-09-271-6/+6
| | | | llvm-svn: 191473
* llvm-objdump: Dump COFF import table if -private-headers option is given.Rui Ueyama2013-09-273-3/+58
| | | | | | | | | | | | | | | | This is a patch to add capability to llvm-objdump to dump COFF Import Table entries, so that we can write tests for LLD checking Import Table contents. llvm-objdump did not print anything but just file name if the format is COFF and -private-headers option is given. This is a patch adds capability for dumping DLL Import Table, which is specific to the COFF format. In this patch I defined a new iterator to iterate over import table entries. Also added a few functions to COFFObjectFile.cpp to access fields of the entry. Differential Revision: http://llvm-reviews.chandlerc.com/D1719 llvm-svn: 191472
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-09-011-15/+15
| | | | llvm-svn: 189728
* Revert "Fix the build broken by r189315." and "Move everything depending on ↵Charles Davis2013-08-271-16/+15
| | | | | | | | | 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-15/+16
| | | | llvm-svn: 189315
OpenPOWER on IntegriCloud