summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [PECOFF] Make a member functions non-virtual.Rui Ueyama2013-12-111-1/+1
| | | | llvm-svn: 197006
* [PECOFF] Writer: Remove NULL padding at the end of each section.Rui Ueyama2013-12-111-13/+4
| | | | | | | | If section size is not multiple of 512, the writer added NULL bytes at the end of it to make it so. That is not required by the PE/COFF spec, and the MSVC's linker does not do that too. So we don't need to do that, too. llvm-svn: 197002
* s/NULL/nullptr/Rui Ueyama2013-12-111-1/+1
| | | | llvm-svn: 196994
* [PECOFF] WriterPECOFF: Rename getCharacteristics -> computeCharacteristics.Rui Ueyama2013-12-111-7/+6
| | | | | | | The base class has a member function with the same name. We should avoid it being shadowed. llvm-svn: 196992
* [PECOFF] WriterPECOFF::ExecutableWriter: Small cleanup.Rui Ueyama2013-12-111-3/+4
| | | | llvm-svn: 196991
* Add explicit keyword.Rui Ueyama2013-12-101-4/+5
| | | | llvm-svn: 196898
* [PECOFF] Make more member functions non-virtual.Rui Ueyama2013-12-101-4/+4
| | | | llvm-svn: 196897
* [PECOFF] Optimize the writer a bit by removing a loop.Rui Ueyama2013-12-101-45/+33
| | | | llvm-svn: 196896
* [PECOFF] Refactor COFF section header creation.Rui Ueyama2013-12-101-75/+46
| | | | | | | Code to create COFF section header was scattered across many member functions of SectionChunk. Consolidate it to a member function of SectionHeaderTableChunk. llvm-svn: 196895
* Add more const qualifiers.Rui Ueyama2013-12-101-4/+5
| | | | llvm-svn: 196891
* Remove data members used for relocationsRui Ueyama2013-12-101-11/+17
| | | | | | ... because they are used only in the function for relocations. llvm-svn: 196890
* Skip the body of a loop as early as possible.Rui Ueyama2013-12-101-4/+4
| | | | llvm-svn: 196884
* Add const qualifiers.Rui Ueyama2013-12-101-29/+31
| | | | llvm-svn: 196867
* [PECOFF] Make some member functions non-virtual.Rui Ueyama2013-12-101-18/+13
| | | | | | | These member functions are not overriden and not intended to be, so adding virtual does not make sense. llvm-svn: 196866
* [PECOFF] Simplify PE/COFF header writer.Rui Ueyama2013-12-091-18/+12
| | | | llvm-svn: 196767
* [PECOFF] Simplify WriterPECOFF.Rui Ueyama2013-12-091-5/+1
| | | | llvm-svn: 196762
* Delete dead code.Rui Ueyama2013-12-041-19/+0
| | | | llvm-svn: 196366
* [PECOFF] Implement IMAGE_REL_I386_{SECTION,SECREL} relocations.Rui Ueyama2013-12-031-6/+40
| | | | | | These relocations are used in .debug section. llvm-svn: 196262
* Fix a variety of typos in function names and commentsAlp Toker2013-12-011-1/+1
| | | | | | No change in functionality. llvm-svn: 196053
* [PECOFF] Set section characteristics based /section options.Rui Ueyama2013-11-271-31/+40
| | | | | | | | This is a patch to let the PECOFF writer to use the information passed by the parser for /section option. The implementation of /section should now be complete. llvm-svn: 195893
* [PECOFF] Implement /merge option.Rui Ueyama2013-11-271-5/+7
| | | | | | | /MERGE:foo=bar command line option merges section foo to section bar. If section bar does not exist, foo is just renamed as bar. llvm-svn: 195856
* [PECOFF] Add a generic section writer.Rui Ueyama2013-11-271-135/+142
| | | | | | | | | | | | | | | | Instead of having multiple SectionChunks for each section (.text, .data, .rdata and .bss), we could have one chunk writer that can emit any sections. This patch does that -- removing all section-sepcific chunk writers and replace them with one "generic" writer. This change should simplify the code because it eliminates similar-but- slightly-different classes. It also fixes an issue in the previous design. Before this patch, we could emit only limited set of sections (i.e. .text, .data, .rdata and .bss). With this patch, we can emit any sections. llvm-svn: 195797
* Revert "WriterPECOFF"Rui Ueyama2013-11-271-142/+135
| | | | | | This reverts accidental commit r195794. llvm-svn: 195795
* WriterPECOFFRui Ueyama2013-11-271-135/+142
| | | | llvm-svn: 195794
* [PECOFF] String pointed by StringRef is not always NUL-terminated.Rui Ueyama2013-11-251-1/+2
| | | | | | | In order not to overrun a StringRef and copy the trailing garbage, we need to set the maximum length to be copied by strncpy. llvm-svn: 195688
* [PECOFF] Set ordinals to linker internal atoms.Rui Ueyama2013-11-251-6/+9
| | | | | | | | | This patch won't change the output because the layout of linker internal atoms is forced by layout-{before,after} references. Ordinals of the linker internal atoms are not currently used. (That's why it's working even if there are atoms having the same ordinals.) llvm-svn: 195610
* [PECOFF] Change sectionChoice attribute.Rui Ueyama2013-11-251-1/+0
| | | | | | | | | | | | | Change the attribute from sectionBasedOnContent to sectionCustomRequired because its the right attribute for atoms read from COFF files to have. COFF atoms should basically be emitted to the section having the same name as input. Permissions/attributes should not affect that. There's no functionality change because the writer doesn't yet use the section name. The writer will be modified in a following patch, so that atoms are written to its customSectionName()'s section. llvm-svn: 195595
* Do not inline large member functions.Rui Ueyama2013-11-191-494/+553
| | | | | | | This should improve code readability as the class definitions are now more readable than before. llvm-svn: 195159
* Fix Windows buildbot on which size_t is not unsinged long.Rui Ueyama2013-11-151-1/+1
| | | | llvm-svn: 194793
* [PECOFF] Minimum size of DOS stub is 64 byte.Rui Ueyama2013-11-151-2/+6
| | | | llvm-svn: 194791
* [PECOFF] Avoid using statically initialized std::vector.Rui Ueyama2013-11-151-6/+7
| | | | | | Also slightly reduces PECOFFLinkingContext's memory footprint (~128B). llvm-svn: 194787
* Move DOS stub data to PECOFFLinkingContext for /stub option.Rui Ueyama2013-11-141-18/+8
| | | | llvm-svn: 194754
* [PECOFF] Rename getSectionAlignment -> getSectionDefaultAlignment.Rui Ueyama2013-11-061-1/+1
| | | | | | | | These fields are for /align option. Section alignment can be set per-section basis with /section option too. In order to avoid name conflicts, rename the existing identifiers to become more specific. No functionality change. llvm-svn: 194160
* [PECOFF] Remove unnecessary assertion.Rui Ueyama2013-11-011-14/+0
| | | | | | | | Bugs that would be caught by this assertion would also be caught by RoundTripYAMLPass test. We've enabled the pass for PECOFF, so we can remove this. llvm-svn: 193886
* Remove redundant std::move().Rui Ueyama2013-11-011-2/+2
| | | | llvm-svn: 193883
* [PECOFF] Change data directory atom structure.Rui Ueyama2013-11-011-15/+20
| | | | | | | | | | | | The data directory in the PE/COFF header consisted of list of data directory atoms. This patch changes it -- now there's only one data directory entry that contains former data directories. That's easier to handle in the writer as well as to write to/read from YAML/Native files. The main purpose of this refactoring is to enable RoundTrip tests for PE/COFF. There's no functionality change. llvm-svn: 193854
* Revert "[PECOFF] Add atoms to the PassManager file"Rui Ueyama2013-10-311-0/+14
| | | | | | | | | | | | | | | This reverts commit r193479. The atoms are already added to the file, so re-adding them caused the YAML writer to write the same atoms twice. That made the YAML reader to fail with "duplicate atom name" error. This is not the only error we've got for RoundTripYAMLPass for PECOFF, so we cannot enable the test yet. More fixes will come. Differential Revision: http://llvm-reviews.chandlerc.com/D2069 llvm-svn: 193762
* Remove unused variable.Rui Ueyama2013-10-231-3/+0
| | | | llvm-svn: 193266
* Revert "Initialize some members where they are declared."Rui Ueyama2013-10-211-7/+8
| | | | | | | Because MSVC11 doesn't like this new C++11 feature. The last commit broke the buildbot. llvm-svn: 193127
* Initialize some members where they are declared. No functionality change.Rui Ueyama2013-10-211-8/+7
| | | | llvm-svn: 193122
* Fill the atom gap with INT 3 instead of NOP.Rui Ueyama2013-10-181-2/+2
| | | | | | | | INT 3 (machine code 0xCC) will raise an interrupt when executed. That is better for filling the gap than NOP because we want to stop the execution immediately when the control reached to non-code address. llvm-svn: 192945
* Fill gap in .text with NOP.Rui Ueyama2013-10-171-0/+14
| | | | llvm-svn: 192930
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-071-1/+0
| | | | | | | | | | | | Changes :- a) Functionality in InputGraph to insert Input elements at any position b) Functionality in the Resolver to use nextFile c) Move the functionality of assigning file ordinals to InputGraph d) Changes all inputs to MemoryBuffers e) Remove LinkerInput, InputFiles, ReaderArchive llvm-svn: 192081
* [PECOFF] Add /swaprun:{cd,net} options.Rui Ueyama2013-09-241-0/+4
| | | | llvm-svn: 191276
* [PECOFF] Add /allowisolation command line option.Rui Ueyama2013-09-231-0/+2
| | | | llvm-svn: 191227
* [PECOFF] Add /allowbind command line option.Rui Ueyama2013-09-231-0/+2
| | | | llvm-svn: 191224
* [lld][PECOFF] Fix data directory entry RVA of base relocations sectionRon Ofir2013-09-231-2/+3
| | | | | | | | | | | | | | | | | | | Summary: This patch changes WriterPECOFF to actually write down the address instead of ignoring it. Also, it changes the order of adding the BaseReloc chunk as otherwise the address wasn't set yet. I think a better way of doing it would be to change DataDirectoryAtom to create a Reference instead of using a number, and to change IdataPass accordingly, but I'm not sure how to do that. Reviewers: ruiu Reviewed By: ruiu CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1743 llvm-svn: 191220
* [PECOFF] Add /align command line option.Rui Ueyama2013-09-231-1/+1
| | | | llvm-svn: 191218
* Whitespace and extra parentheses.Rui Ueyama2013-09-231-2/+2
| | | | llvm-svn: 191217
* [lld][PECOFF] Calculate SizeOfHeaders field instead of using a hard-coded valueRon Ofir2013-09-231-4/+10
| | | | | | | | | | | | | | Summary: This patch changes WritePECOFF to calculate the value of the SizeOfHeaders PE header field instead of just using 512. Reviewers: rui314, ruiu Reviewed By: ruiu CC: llvm-commits, ruiu Differential Revision: http://llvm-reviews.chandlerc.com/D1708 llvm-svn: 191212
OpenPOWER on IntegriCloud