summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [PECOFF][Driver] Support /version command line optionRui Ueyama2013-09-191-1/+8
| | | | llvm-svn: 190986
* [PECOFF] Fix base relocation block alignmentRui Ueyama2013-09-181-2/+5
| | | | | | | | | | | Base relocation block should be aligned on a 32-bit boundary. While the PECOFF spec mentions only aligning the blocks, and not padding them, link.exe seems to add an extra IMAGE_REL_I386_ABSOLUTE entry (just a zeroed WORD) in order to pad the blocks. Patch by Ron Ofir. llvm-svn: 190951
* [PECOFF] Make helper functions private.Rui Ueyama2013-09-181-21/+21
| | | | llvm-svn: 190949
* [PECOFF] Take into account all sections when setting size fields in the PE ↵Rui Ueyama2013-09-161-3/+28
| | | | | | | | | | | | | | | header This patch changes lld to go through all sections while calculating the size for SizeOfCode, SizeOfInitializedData and SizeOfUninitializedData fields in the PE header, instead of using only a small set of hard-coded sections. This only really changes SizeOfInitializedData which didn't include .reloc section before this patch. Patch by Ron Ofir. llvm-svn: 190799
* [PECOFF] Add DISCARDABLE characteristic to .reloc sectionRui Ueyama2013-09-161-1/+2
| | | | | | | | | This patch sets the IMAGE_SCN_MEM_DISCARDABLE characteristic to the base relocations section in order to match MS PECOFF specification. Patch by Ron Ofir. llvm-svn: 190798
* [PECOFF] Add a field for machine type to PECOFFLinkingContext.Rui Ueyama2013-09-121-1/+1
| | | | | | | | | So that we can determine what the target architecture is. Adding this field does not mean that we are going to support non-i386 architectures soon; there are many things to do to support them, and I'm focusing on i386 now. But this is the first step toward multi architecture support. llvm-svn: 190627
* [PECOFF] Don't add RVAs to base relocations table.Rui Ueyama2013-09-061-5/+10
| | | | | | Patch by Ron Ofir. llvm-svn: 190210
* [PECOFF] Align section contents as specified by the object file's section ↵Rui Ueyama2013-09-061-0/+5
| | | | | | header. llvm-svn: 190120
* [PECOFF] Add helper functions for debuggingRui Ueyama2013-08-291-0/+20
| | | | llvm-svn: 189570
* [PECOFF] Add Support for entry point symbol nameRui Ueyama2013-08-261-0/+29
| | | | | | Patch by Jesús Serrano García. llvm-svn: 189267
* Separates /fixed (no .reloc section) and /dynamicbase (enable ASLR)Rui Ueyama2013-08-241-1/+1
| | | | | | | | in order to match link.exe's behaviour. Patch by Ron Ofir. llvm-svn: 189159
* [PECOFF] Fixed base images now have the IMAGE_FILE_RELOCS_STRIPPED flagRui Ueyama2013-08-121-0/+3
| | | | | | Patch by Ron Ofir. llvm-svn: 188187
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-061-21/+21
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* [PECOFF] Relocations now take into account the address which is stored at ↵Rui Ueyama2013-08-021-0/+2
| | | | | | | | the relocation site Patch by Ron Ofir. llvm-svn: 187664
* [PECOFF] Add a comment about .bss section.Rui Ueyama2013-07-311-0/+9
| | | | llvm-svn: 187505
* Fix comment.Rui Ueyama2013-07-301-1/+1
| | | | llvm-svn: 187461
* [PECOFF] Emit BSS section.Rui Ueyama2013-07-301-2/+35
| | | | llvm-svn: 187460
* [PATCH] [PECOFF] Fill size field of IMAGE_DATA_DIRECTORYRui Ueyama2013-07-261-1/+1
| | | | | | Patch by Ron Ofir. llvm-svn: 187262
* [PECOFF] Don't set IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE if "-fixed" is ↵Rui Ueyama2013-07-261-1/+2
| | | | | | | | provided Based on Ron Ofir's patch. llvm-svn: 187221
* [PECOFF] Replace magic number with llvm::COFF::DataDirectoryIndex valueRui Ueyama2013-07-261-1/+2
| | | | | | Patch by Ron Ofir. llvm-svn: 187220
* [PECOFF] Fixed a bug which caused DataDirectoryChunk to write to a wrong ↵Rui Ueyama2013-07-261-1/+0
| | | | | | | | offset in the file buffer Patch by Ron Ofir. llvm-svn: 187219
* [PECOFF] Support -tsaware:no command line option.Rui Ueyama2013-07-231-3/+5
| | | | llvm-svn: 186957
* [PECOFF] Support -fixed command line option to disable base relocations.Rui Ueyama2013-07-231-6/+10
| | | | llvm-svn: 186911
* [PECOFF][Driver] Add -base command line option.Rui Ueyama2013-07-201-4/+6
| | | | llvm-svn: 186739
* [WinLink] Add /LargeAddressAware command line option.Rui Ueyama2013-07-161-2/+5
| | | | llvm-svn: 186428
* [PECOFF][Writer] Replace magic numbers with sizeof().Rui Ueyama2013-07-161-7/+13
| | | | | | | | | | | | This is a follow up patch for r186336. Reviewers: LegalizeAdulthood CC: silvas, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1144 llvm-svn: 186384
* [PECOFF][Writer] Follow up patch for r186336.Rui Ueyama2013-07-151-3/+3
| | | | | | | - Make a const reference instead of copying an object - Fix a comment llvm-svn: 186355
* [PECOFF][Writer] s/dyn_cast/cast/ where we don't expect null return value.Rui Ueyama2013-07-151-3/+3
| | | | llvm-svn: 186353
* [PECOFF][Writer] Refactoring: Move private methods below public ones.Rui Ueyama2013-07-151-40/+39
| | | | llvm-svn: 186352
* [PECOFF] Fix comment.Rui Ueyama2013-07-151-3/+3
| | | | llvm-svn: 186346
* [PECOFF][Writer] Emit .reloc section.Rui Ueyama2013-07-151-48/+203
| | | | | | | | | | | | | Emit .reloc section. This is the first step to support DLL creation. The executable doesn't need .reloc section, but the DLL does. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1126 llvm-svn: 186336
* [PECOFF] Support linking against DLL.Rui Ueyama2013-07-111-43/+47
| | | | | | | | | | | | | | | This patch adds a new pass, IdataPass, to transform shared atom references to real references and to construct the .idata section data. With this patch lld can produce a working Hello World program by linking it against kernel32.dll and user32.dll. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1096 llvm-svn: 186071
* [PECOFF][Writer] Fixed a bug that an empty section is emit to the section ↵Rui Ueyama2013-07-111-35/+33
| | | | | | header. llvm-svn: 186066
* [PECOFF][Writer] Compute the size of a chunk each time it's added rather ↵Rui Ueyama2013-07-091-42/+34
| | | | | | | | | | | | | | | than all at once. Contents of ".reloc" section depends on the addresses of other sections, so the section cannot be created until all the other sections are created and get their memory addresses (RVAs). That means that computation of section size needs to be at least two pass. Techynically there's no reason to compute it all at once, but instead we can compute the address of a section as added to the output file. Doing so helps us to create ".reloc" section. llvm-svn: 185902
* [PECOFF][Writer] Fix SizeOfImage header. It should include the first ↵Rui Ueyama2013-07-031-6/+4
| | | | | | unmapped page. llvm-svn: 185534
* [PECOFF][Writer] Separate AtomChunk from SectionChunk.Rui Ueyama2013-07-031-15/+31
| | | | | | | | | | | | The optional data directory header contains addresses to some atoms such as the import address table in data section. Such fields can naturally be set by relocation if we make the optional data driectory as an atom. Currently we assume that atoms are always in a section, so we can't create a file header with atoms. This patch separates section chunk from atom chunk, to allow atom-based file header. llvm-svn: 185521
* Add "explicit" to ctors where appropriate.Rui Ueyama2013-07-031-3/+3
| | | | llvm-svn: 185517
* [PECOFF][Writer] Set SizeOfInitializedData file header.Rui Ueyama2013-07-011-0/+9
| | | | llvm-svn: 185310
* [PECOFF][Writer] Add setter methods that sets the import address table ↵Rui Ueyama2013-07-011-2/+18
| | | | | | location to file header. llvm-svn: 185309
* [PECOFF][Writer] Do not emit the empty section as Windows loader rejects ↵Rui Ueyama2013-07-011-1/+10
| | | | | | such executable. llvm-svn: 185308
* Remove extra ';'Rui Ueyama2013-06-291-1/+1
| | | | llvm-svn: 185247
* [PECOFF][Writer] Fix wrong section header.Rui Ueyama2013-06-281-4/+7
| | | | llvm-svn: 185205
* [PECOFF][Writer] Remove duplicated code by moving it to parent class.Rui Ueyama2013-06-281-104/+88
| | | | llvm-svn: 185200
* [PECOFF][Writer] Support DIR32NB and REL32 relocation types.Rui Ueyama2013-06-281-3/+18
| | | | llvm-svn: 185133
* [PECOFF][Writer] Fix a bug that the contents of .data and .rdata were swapped.Rui Ueyama2013-06-281-3/+2
| | | | llvm-svn: 185130
* [PECOFF][Writer] Use a constant instead of a magic number.Rui Ueyama2013-06-281-2/+2
| | | | llvm-svn: 185128
* [PECOFF][Writer] Fix DLLCharacteristic flag in image header.Rui Ueyama2013-06-271-0/+6
| | | | llvm-svn: 185102
* [PECOFF] Connect defined atoms with layout before/after edges.Rui Ueyama2013-06-171-0/+5
| | | | | | | | | | Reviewers: shankarke CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D989 llvm-svn: 184085
* [lld][PECOFF] Support IMAGE_REL_I386_DIR32 relocation.Rui Ueyama2013-06-161-10/+63
| | | | | | | | | | | | | | With this patch, it can now resolve relocations in the same output file. "Hello world" program does not still work because call to the DLL routine is not supported yet. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D985 llvm-svn: 184063
* [lld] Move AtomLayout from ELF to Core so that it can be used by non-ELF ↵Rui Ueyama2013-06-161-0/+1
| | | | | | | | | | | | | | writers. Summary: I'm planning to use AtomLayout in WriterPECOFF. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D977 llvm-svn: 184062
OpenPOWER on IntegriCloud