summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-readobj/COFFDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* llvm-readobj: print out the fields of the COFF delay-import tableRui Ueyama2014-10-031-0/+8
| | | | llvm-svn: 218996
* llvm-readobj: print COFF delay-load import tableRui Ueyama2014-10-031-8/+27
| | | | | | | | | This patch adds another iterator to access the delay-load import table and use it from llvm-readobj. http://reviews.llvm.org/D5594 llvm-svn: 218933
* llvm-readobj: print COFF imported symbolsRui Ueyama2014-10-021-0/+8
| | | | | | | | This patch defines a new iterator for the imported symbols. Make a change to COFFDumper to use that iterator to print out imported symbols and its ordinals. llvm-svn: 218915
* This patch adds a new flag "-coff-imports" to llvm-readobj.Rui Ueyama2014-10-021-0/+15
| | | | | | | | | | | | | | When the flag is given, the command prints out the COFF import table. Currently only the import table directory will be printed. I'm going to make another patch to print out the imported symbols. The implementation of import directory entry iterator in COFFObjectFile.cpp was buggy. This patch fixes that too. http://reviews.llvm.org/D5569 llvm-svn: 218891
* Object: BSS/virtual sections don't have contentsDavid Majnemer2014-09-261-1/+2
| | | | | | | | | | | | 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
* llvm-readobj: pretty-print special COFF section namesDavid Majnemer2014-09-201-3/+19
| | | | | | Print IMAGE_SYM_DEBUG and the like instead of (-2). llvm-svn: 218172
* MC: Add support for BigObjDavid Majnemer2014-09-151-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Teach WinCOFFObjectWriter how to write -mbig-obj style object files; these object files allow for more sections inside an object file. Our support for BigObj is notably different from binutils and cl: we implicitly upgrade object files to BigObj instead of asking the user to compile the same file *again* but with another flag. This matches up with how LLVM treats ELF variants. This was tested by forcing LLVM to always emit BigObj files and running the entire test suite. A specific test has also been added. I've lowered the maximum number of sections in a normal COFF file, VS "14" CTP 3 supports no more than 65279 sections. This is important otherwise we might not switch to BigObj quickly enough, leaving us with a COFF file that we couldn't link. yaml2obj support is all that remains to implement. Differential Revision: http://reviews.llvm.org/D5349 llvm-svn: 217812
* Object: Add support for bigobjDavid Majnemer2014-09-101-55/+42
| | | | | | | | | | | | | | | | | | | | | | 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
* Remove 'virtual' keyword from methods markedwith 'override' keyword.Craig Topper2014-08-301-6/+6
| | | | llvm-svn: 216823
* Support: update DLLCharacteristics enumerationSaleem Abdulrasool2014-06-271-0/+2
| | | | | | | | Add the new AppContainer characteristic which is import for Windows Store (Metro) compatible applications. Add the new Control Flow Guard flag to bring the enumeration up to date with the current values as of Windows 8.1. llvm-svn: 211855
* Remove 'using std::error_code' from tools.Rafael Espindola2014-06-131-27/+29
| | | | llvm-svn: 210876
* Remove all uses of 'using std::error_code' from headers.Rafael Espindola2014-06-131-0/+1
| | | | llvm-svn: 210866
* Remove system_error.h.Rafael Espindola2014-06-121-2/+2
| | | | | | | 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
* tools: initial implementation of WoA EH decodingSaleem Abdulrasool2014-06-041-0/+6
| | | | | | | | | | | | | Add support to llvm-readobj to decode Windows ARM Exception Handling data. This uses the previously added datastructures to decode the information into a format that can be used by tests. This is a necessary step to add support for emitting Windows on ARM exception handling information. A fair amount of formatting inspiration is drawn from the Win64 EH printer as well as the ARM EHABI printer. This allows for a reasonably thorough look into the encoded data. llvm-svn: 210192
* tools: avoid use of std::functionSaleem Abdulrasool2014-05-251-4/+5
| | | | | | | | | | | Remove the use of the std::function and replace the capturing lambda with a non-capturing one, opting to pass the user data down to the context. This is needed as std::function is not yet available on all hosted platforms (it requires RTTI, which breaks on Windows). Thanks to Nico Rieck for pointing this out! llvm-svn: 209607
* tools: split out Win64EHDumper from COFFDumperSaleem Abdulrasool2014-05-251-328/+16
| | | | | | | | | | Move the implementation of the Win64 EH printer from the COFFDumper into its own class. This is in preparation for adding support to print ARM EH information. The only real change here is in printUnwindInfo where we now lambda lift the implicit this parameter for the resolveFunction. Also setup the printing to handle ARM. This now has set the stage to introduce ARM EH printing. llvm-svn: 209606
* tools: inline simple single-use functionSaleem Abdulrasool2014-05-251-18/+6
| | | | | | | This inlines the single use function in preparation for splitting the Win64EH printing out of the COFFDumper into its own entity. llvm-svn: 209605
* tools: refactor COFFDumper symbol resolution logicSaleem Abdulrasool2014-05-251-61/+69
| | | | | | | | | | Make the use of the cache more transparent to the users. There is no reason that the cached entries really need to be passed along. The overhead for doing so is minimal: a single extra parameter. This requires that some standalone functions be brought into the COFFDumper class so that they may access the cache. llvm-svn: 209604
* tools: use references rather than out pointers in COFFDumperSaleem Abdulrasool2014-05-251-18/+8
| | | | | | | Switch to use references for parameters that are guaranteed to be non-null. Simplifies the code a slight bit in preparation for another change. llvm-svn: 209603
* llvm-readobj: remove some dead codeSaleem Abdulrasool2014-05-241-28/+0
| | | | llvm-svn: 209586
* llvm-readobj: use range-based for loopSaleem Abdulrasool2014-05-201-5/+3
| | | | | | Convert an additional site to a range based for loop. NFC. llvm-svn: 209194
* [C++] Use 'nullptr'. Tools edition.Craig Topper2014-04-251-6/+7
| | | | llvm-svn: 207176
* tools: fix invalid printing, buffer overrun in llvm-readobjSaleem Abdulrasool2014-04-161-0/+1
| | | | | | All auxiliary records are consumed when accessing a File record. llvm-svn: 206354
* tools: address possible non-null terminated filenamesSaleem Abdulrasool2014-04-141-1/+4
| | | | | | | | | If a filename is a multiple of 18 characters, there will be no null-terminator. This will result in an invalid access by the constructed StringRef. Add a test case to exercise this and fix that handling. Address this same vulnerability in llvm-readobj as well. llvm-svn: 206145
* tools: remove duplication of coff_aux_fileSaleem Abdulrasool2014-04-131-9/+1
| | | | | | | Now that COFF::coff_aux_file is defined, use that rather than redefining the type locally. llvm-svn: 206140
* Object: Provide a richer means of describing auxiliary symbolsDavid Majnemer2014-03-191-18/+5
| | | | | | | | | | | | | | | | The current state of affairs has auxiliary symbols described as a big bag of bytes. This is less than satisfying, it detracts from the YAML file as being human readable. Instead, allow for symbols to optionally contain their auxiliary data. This allows us to have a much higher level way of describing things like weak symbols, function definitions and section definitions. This depends on D3105. Differential Revision: http://llvm-reviews.chandlerc.com/D3092 llvm-svn: 204214
* Object: Move auxiliary symbol definitions from llvm-readobjDavid Majnemer2014-03-191-26/+7
| | | | | | | | | | | | Summary: These definitions are useful to other aspects of LLVM, move them out. Reviewers: rafael, nrieck, ruiu CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3105 llvm-svn: 204213
* Object/COFF: Add function to check if section number is reserved one.Rui Ueyama2014-03-181-1/+1
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D3103 llvm-svn: 204199
* [C++11] Change the interface of getCOFF{Section,Relocation,Symbol} to make ↵Alexey Samsonov2014-03-181-51/+40
| | | | | | | | | | | | | | 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
* llvm-readobj: Print referred symbol name for CLR token definitionNico Rieck2014-03-171-1/+10
| | | | llvm-svn: 204024
* llvm-readobj: Add test for COFF auxiliary symbols as used by C++/CLINico Rieck2014-03-171-1/+3
| | | | llvm-svn: 204023
* [C++11] Introduce SectionRef::relocations() to use range-based loopsAlexey Samsonov2014-03-141-22/+20
| | | | | | | | | | | | Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3077 llvm-svn: 203927
* Object: rename ARMV7 to ARMNTSaleem Abdulrasool2014-03-111-1/+1
| | | | | | | The official specifications state the name to be ARMNT (as per the Microsoft Portable Executable and Common Object Format Specification v8.3). llvm-svn: 203530
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-3/+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-18/+18
| | | | llvm-svn: 201108
* Simplify the handling of iterators in ObjectFile.Rafael Espindola2014-01-301-42/+10
| | | | | | | | | | | | 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
* Rename IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA.Rui Ueyama2014-01-271-2/+1
| | | | | | | editbin.exe and link.exe both accepts /highentropyva option to set this bit, so doing s/VIRTUAL_ADDRESS/VA/ should make sense. llvm-svn: 200191
* COFF: Add a missing enum value for high entropy ASLR.Rui Ueyama2014-01-261-0/+2
| | | | | | | | | That bit is not documented in the PE/COFF spec published by Microsoft, so we don't know the official name of it. I named this bit IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VIRTUAL_ADDRESS because the bit is reported as "high entropy virtual address" by dumpbin.exe, llvm-svn: 200121
* llvm-readobj: add support for PE32+ (Windows 64 bit executable).Rui Ueyama2014-01-261-48/+63
| | | | | | | | | | | | PE32+ supports 64 bit address space, but the file format remains 32 bit. So its file format is pretty similar to PE32 (32 bit executable). The differences compared to PE32 are (1) the lack of "BaseOfData" field and (2) some of its data members are 64 bit. In this patch, I added a new member function to get a PE32+ Header object to COFFObjectFile class and made llvm-readobj to use it. llvm-svn: 200117
* Re-sort #include lines again, prior to moving headers around.Chandler Carruth2014-01-131-5/+2
| | | | llvm-svn: 199080
* Teach the llvm-readobj COFF dumper to dump debug line tables from object filesTimur Iskhodzhanov2013-12-191-0/+165
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D2425 llvm-svn: 197674
* Retry submitting r186623: COFFDumper: Dump data directory entries.Rui Ueyama2013-07-191-0/+24
| | | | | | | | The original change was rolled back in r186627 because of test failures on the big endian machine. I believe I fixed the issue so re-submitting. llvm-svn: 186734
* Revert "COFFDumper: Dump data directory entries."Rui Ueyama2013-07-181-24/+0
| | | | | | Because it broke s390x and ppc64-linux buildbots. This reverts commit r186623. llvm-svn: 186627
* COFFDumper: Dump data directory entries.Rui Ueyama2013-07-181-0/+24
| | | | | | | | | | | | | | | | | Summary: Dump optional data directory entries in the PE/COFF header, so that we can test the output of LLD linker. This patch updates the test binary file, but the source of the binary is the same. I just re-linked the file. I don't know how the previous file was linked, but the previous file did not have any data directory entries for some reason. Reviewers: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1148 llvm-svn: 186623
* COFFDumper: Print uint64_t with the right format string.Benjamin Kramer2013-07-061-3/+3
| | | | | | I wish we could typecheck llvm::format. llvm-svn: 185766
* readobj: Dump PE/COFF optional records.Rui Ueyama2013-06-121-11/+77
| | | | | | | | | | | | 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
* Handle relocations that don't point to symbols.Rafael Espindola2013-06-051-5/+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
* llvm-readobj: Dump more COFF auxiliary recordsNico Rieck2013-04-221-1/+6
| | | | llvm-svn: 180007
* llvm-readobj: Check for null section pointerNico Rieck2013-04-221-1/+1
| | | | llvm-svn: 180006
OpenPOWER on IntegriCloud