summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/WindowsResource.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Clean up some things in the WindowsResource changes.Eric Beckmann2017-06-161-102/+93
| | | | llvm-svn: 305596
* [Object] Remove redundant std::move.Benjamin Kramer2017-06-161-1/+1
| | | | | | Found by -Wpessimizing-move. llvm-svn: 305595
* Switch external cvtres.exe for llvm's own resource library.Eric Beckmann2017-06-161-29/+24
| | | | | | | | | | | | | | | | | | | | | | | | In this patch, I flip the switch in DriverUtils from using the external cvtres.exe tool to using the Windows Resource library in llvm. I also fixed a bug where .rsrc sections were marked as discardable memory and therefore were placed in the wrong order in the final PE. Furthermore, I modified WindowsResource to write the coff directly to a memory buffer instead of to file, also had it use the machine types already declared in COFF.h instead creating my own enum. Finally, I flipped the switch to allow all unit tests that had previously run only on windows due to a winres dependency to run cross-platform. Reviewers: zturner, ruiu Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34265 llvm-svn: 305592
* Use reference to iterate through string table instead of copying.Eric Beckmann2017-06-131-1/+1
| | | | | | | | | | Summary: just a quick patch Subscribers: ruiu, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34171 llvm-svn: 305324
* Fix a bug introduced in r305092 on big-endian systems.Eric Beckmann2017-06-131-3/+1
| | | | | | | | | | | | | | Summary: We were writing the length of the string based on system-endianness, and not universally little-endian. This fixes that. Reviewers: zturner Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D34159 llvm-svn: 305322
* Fix alignment complaint.Eric Beckmann2017-06-131-3/+2
| | | | | | | | | | Summary: Apparently we need to write using a void* pointer on some architectures, or else alignment error is caused. Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D34166 llvm-svn: 305320
* Improve error messages in order to help with fixing a big-endian bug.Eric Beckmann2017-06-131-3/+3
| | | | | | | | | | | | Summary: Added output to stderr so that we can actually see what is happening when the test fails on big endian. Reviewers: zturner Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34155 llvm-svn: 305314
* Revert "Revert "Fix alignment bug in COFF emission.""Eric Beckmann2017-06-131-46/+67
| | | | | | | | | | This revert was done so that my other patch to add test framework could land separately. Now the revert can be reverted and this patch can reland. This reverts commit 18b3c75b2b0d32601fb60a06b9672c33d6f0dff9. llvm-svn: 305259
* Update the test framework for llvm-cvtres to be more comprehensive.Eric Beckmann2017-06-131-15/+21
| | | | | | | | | | Summary: Added test cases for multiple machine types, file merging, multiple languages, and more resource types. Also fixed new bugs these tests exposed. Subscribers: javed.absar, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34047 llvm-svn: 305258
* Revert "Fix alignment bug in COFF emission."Eric Beckmann2017-06-131-88/+61
| | | | | | | | | I accidentally combined this patch with one for adding more tests, they should be separated. This reverts commit 3da218a523be78df32e637d3446ecf97c9ea0465. llvm-svn: 305257
* Fix alignment bug in COFF emission.Eric Beckmann2017-06-131-61/+88
| | | | | | | | | | | | Summary: Fix alignment issue in D34020, by aligning all sections to 8 bytes. Reviewers: zturner Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D34072 llvm-svn: 305256
* Fix a ubsan failure introduced by r305092Vedant Kumar2017-06-101-2/+2
| | | | | | | | | | | | lib/Object/WindowsResource.cpp:578:3: runtime error: store to misaligned address 0x7fa09aedebbe for type 'unsigned int', which requires 4 byte alignment 0x7fa09aedebbe: note: pointer points here 00 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ llvm-svn: 305149
* Implement COFF emission for parsed Windows Resource ( .res) files.Eric Beckmann2017-06-091-9/+507
| | | | | | | | | | | | Summary: Add the WindowsResourceCOFFWriter class for producing the final COFF after all parsing is done. Reviewers: hiraditya!, zturner, ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34020 llvm-svn: 305092
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-071-1/+1
| | | | | | | | | | | | This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
* Fix bug on Big-Endian system, due to reference to vector out of scope.Eric Beckmann2017-05-301-1/+1
| | | | llvm-svn: 304255
* This patch should fix various clang warnings and a use of to_stringEric Beckmann2017-05-301-1/+2
| | | | | | which isn't support before c++11. llvm-svn: 304252
* [Object] Remove unused field + constructor.Benjamin Kramer2017-05-301-2/+0
| | | | llvm-svn: 304233
* [Object] Fix pessimizing move.Benjamin Kramer2017-05-301-1/+1
| | | | | | | Returning the Error by value triggers copy elision, the move is more expensive. Clang rightfully warns about it. llvm-svn: 304232
* Adding parsing ability for .res file.Eric Beckmann2017-05-301-12/+145
| | | | | | | | Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33566 llvm-svn: 304225
* Fix -Wunneeded-internal-declaration by removing constant arrays only used in ↵David Blaikie2017-05-201-6/+4
| | | | | | sizeof expressions, in favor of constants containing the size directly llvm-svn: 303483
* Add functionality to cvtres to parse all entries in res file.Eric Beckmann2017-05-201-0/+92
Summary: Added the new modules in the Object/ folder. Updated the llvm-cvtres interface as well, and added additional tests. Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D33180 llvm-svn: 303480
OpenPOWER on IntegriCloud