aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-objdump/COFFDump.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-10-02Rename data -> DataRui Ueyama1-1/+1
llvm-svn: 218916
2014-09-10Object: Add support for bigobjDavid Majnemer1-9/+2
This adds support for reading the "bigobj" variant of COFF produced by cl's /bigobj and mingw's -mbig-obj. The most significant difference that bigobj brings is more than 2**16 sections to COFF. bigobj brings a few interesting differences with it: - It doesn't have a Characteristics field in the file header. - It doesn't have a SizeOfOptionalHeader field in the file header (it's only used in executable files). - Auxiliary symbol records have the same width as a symbol table entry. Since symbol table entries are bigger, so are auxiliary symbol records. Write support will come soon. Differential Revision: http://reviews.llvm.org/D5259 llvm-svn: 217496
2014-06-13Remove 'using std::error_code' from tools.Rafael Espindola1-22/+20
llvm-svn: 210876
2014-06-13Remove all uses of 'using std::error_code' from headers.Rafael Espindola1-0/+1
llvm-svn: 210866
2014-06-12Remove system_error.h.Rafael Espindola1-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
2014-03-18[C++11] Change the interface of getCOFF{Section,Relocation,Symbol} to make ↵Alexey Samsonov1-6/+5
it work with range-based for loops. Reviewers: ruiu Reviewed By: ruiu CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3097 llvm-svn: 204120
2014-03-14[C++11] Introduce SectionRef::relocations() to use range-based loopsAlexey Samsonov1-4/+2
Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3077 llvm-svn: 203927
2014-03-05Attempt to unbreak little-endian buildbots.Rui Ueyama1-3/+6
llvm-svn: 203023
2014-03-04llvm-objdump: Indent unwind info contents.Rui Ueyama1-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
2014-03-04llvm-objdump: Fix typo in output.Rui Ueyama1-1/+1
llvm-svn: 202875
2014-03-04Fix typo.Rui Ueyama1-3/+3
llvm-svn: 202787
2014-03-04Use auto for readability.Rui Ueyama1-5/+3
llvm-svn: 202786
2014-03-04llvm-objdump: Print x64 unwind info in executable.Rui Ueyama1-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
2014-03-04llvm-objdump: Split printRuntimeFunction to two small functions.Rui Ueyama1-39/+41
No functionality change. llvm-svn: 202781
2014-03-04llvm-objdump: Split printCOFFUnwindInfo into small functions.Rui Ueyama1-105/+123
llvm-svn: 202772
2014-03-04llvm-objdump: Use range-based-for loop and fix format.Rui Ueyama1-14/+18
This is a small cleanup before making a bit larger change to this function. llvm-svn: 202770
2014-02-28llvm-objdump: Fix crash bug with printing unwind info on stripped file.Rui Ueyama1-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
2014-02-28Style fix.Rui Ueyama1-1/+2
llvm-svn: 202465
2014-02-28Remove unnecessary temporary variable.Rui Ueyama1-4/+2
llvm-svn: 202445
2014-02-21llvm-objdump/COFF: LoadConfiguration does not exist in object file.Rui Ueyama1-0/+7
llvm-svn: 201883
2014-02-20llvm-objdump/COFF: Print SEH table addresses.Rui Ueyama1-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
2014-02-19llvm-objdump/COFF: Print load configuration table.Rui Ueyama1-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
2014-02-10Change the begin and end methods in ObjectFile to match the style guide.Rafael Espindola1-4/+4
llvm-svn: 201108
2014-01-30Simplify the handling of iterators in ObjectFile.Rafael Espindola1-18/+5
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
2014-01-24Fix known typosAlp Toker1-1/+1
Sweep the codebase for common typos. Includes some changes to visible function names that were misspelt. llvm-svn: 200018
2014-01-17llvm-objdump/COFF: Print ordinal base number.Rui Ueyama1-0/+4
llvm-svn: 199518
2014-01-16Fix style issues.Rui Ueyama1-24/+30
llvm-svn: 199423
2014-01-16llvm-objdump/COFF: Print DLL name in the export table header.Rui Ueyama1-1/+5
llvm-svn: 199422
2014-01-16llmv-objdump/COFF: Print export table contents.Rui Ueyama1-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
2014-01-15llvm-objdump: Don't print "Import table:" header if there's no import table.Rui Ueyama1-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
2013-09-27Object/COFF: Rename getXXX{Begin,End} -> xxx_{begin,end}.Rui Ueyama1-2/+2
It is mentioned in the LLVM coding standard that _begin() and _end() suffixes should be used. llvm-svn: 191569
2013-09-27Re-submit r191472 with a fix for big endian.Rui Ueyama1-0/+46
llvm-objdump: Dump COFF import table if -private-headers option is given. llvm-svn: 191557
2013-09-27Revert "llvm-objdump: Dump COFF import table if -private-headers option is ↵Rui Ueyama1-46/+0
given." This reverts commit r191472 because it's failing on BE machine. llvm-svn: 191480
2013-09-27Fix another -Wnon-pod-varargs error in r191472.Rui Ueyama1-1/+1
llvm-svn: 191474
2013-09-27Fix -Wnon-pod-varargs error in r191472.Rui Ueyama1-6/+6
llvm-svn: 191473
2013-09-27llvm-objdump: Dump COFF import table if -private-headers option is given.Rui Ueyama1-0/+46
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
2013-06-12readobj: Dump PE/COFF optional records.Rui Ueyama1-1/+1
These records are mandatory for executables and are used by the loader. Reviewers: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D939 llvm-svn: 183852
2013-06-05Handle relocations that don't point to symbols.Rafael Espindola1-1/+1
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
2013-01-02Sort a few more #include lines in tools/... unittests/... and utils/...Chandler Carruth1-1/+1
llvm-svn: 171363
2012-12-05Quick build fix for c++03 clang. This needs a proper solution. Note that ↵Michael J. Spencer1-4/+4
these offsets are guaranteed to be correct by Endian.h. llvm-svn: 169438
2012-12-05Add dump of Win64 EH unwind data.Michael J. Spencer1-0/+355
The new command line option -unwind-info dumps the Win64 EH unwind data to the console. This is a nice feature if you need to debug generated EH data (e.g. from LLVM). Includes a test case. Initial patch by João Matos, extensions and rework by Kai Nacke. llvm-svn: 169415