summaryrefslogtreecommitdiffstats
path: root/lld/lib/ReaderWriter
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r188150 to un-break the buildbot.Rui Ueyama2013-08-121-5/+0
| | | | llvm-svn: 188152
* [PECOFF] It's an error if subsystem is not specified.Rui Ueyama2013-08-121-0/+5
| | | | llvm-svn: 188150
* [PECOFF] Add a note about underscore symbol prefix.Rui Ueyama2013-08-091-1/+6
| | | | llvm-svn: 188090
* [PECOFF] Create __ImageBase symbol.Rui Ueyama2013-08-092-20/+134
| | | | | | | | | | | | | __ImageBase is a symbol having 4 byte integer equal to the image base address of the resultant executable. The linker is expected to create the symbol as if it were read from a file. In order to emit the symbol contents only when the symbol is actually referenced, we created a pseudo library file to wrap the linker generated symbol. The library file member is emitted to the output only when the member is actually referenced, which is suitable for our purpose. llvm-svn: 188052
* Fix spelling error. s/Libary/Library/g.Rui Ueyama2013-08-091-1/+1
| | | | llvm-svn: 188049
* [PECOFF] Fully cover the switch for COMDAT attributes and add a comment.Rui Ueyama2013-08-091-2/+13
| | | | llvm-svn: 188046
* Fix comment typo.Rui Ueyama2013-08-091-1/+1
| | | | llvm-svn: 188045
* [PECOFF] Support COMDAT section that contains mergeable atoms.Rui Ueyama2013-08-082-9/+94
| | | | | | | | | | | | | | | The COMDAT section is a section with a special attribute to tell the linker whether the symbols in the section are allowed to be merged or not. This patch add a function to interpret the COMDAT data and set "merge" attribute to the atoms accordingly. LLD supports multiple policies to merge atoms; atoms can be merged by name or by content. COFF supports them, and in addition to that, it supports choose-the-largest-atom policy, which LLD currently does not support. I simply mapped it to merge-by-name attribute for now, but we eventually have to support that policy in the core linker. llvm-svn: 188025
* Update to llvm changes.Michael J. Spencer2013-08-084-152/+263
| | | | llvm-svn: 188021
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-0673-1229/+1059
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* Remove unused using's.Rui Ueyama2013-08-021-4/+0
| | | | llvm-svn: 187690
* [PECOFF] Move more code from Atoms.h to ReaderCOFF.cpp.Rui Ueyama2013-08-022-78/+81
| | | | llvm-svn: 187688
* [PECOFF] Remove COFFDefinedFileAtom::originalOffset().Rui Ueyama2013-08-022-15/+25
| | | | | | | | | | | | | | | | | The aim of this patch is to reduce the dependency from COFFDefinedAtom to COFF structs defined in llvm/Object/COFF.h. Currently many attributes of the atom are computed in the atom. That provide a simple interface but does not work well in some cases. There are some cases that the same type atom is created from different parts of a COFF file. One example is the BSS atom, which can be created from the defined symbol in the .bss section or from the undefined symbol. Computing attributes from different sources in the atom complicates the code. We should compute it outside the atom. In the next patch, I'll move more code from Atoms.h to ReaderCOFF.cpp. llvm-svn: 187681
* [PECOFF] Handle .drectve section.Rui Ueyama2013-08-021-2/+130
| | | | | | | | | | | | | | | | | | | | | | | Summary: The .drectve section contains linker command line options, and the linker is expected to interpret them as if they were given via the command line. In this patch, the command line parser in the driver is called from the object file reader to parse the string. I think this patch is important, because this is the first step towards mutable TargetInfo. We had a discussion about that on llvm-commits mailing list before. I haven't removed "const" from the function signature yet. Instead, I just use cast to remove "const". This is a temporary aid for an experiment. If we don't see any issue with this mutable TargetInfo appraoch, I'll change the function signature, and rename the class LinkerContext from TargetInfo. Reviewers: kledzik CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1246 llvm-svn: 187677
* [PECOFF] Return an error_code instead of calling report_fatal_error().Rui Ueyama2013-08-021-8/+14
| | | | | | | | For an invalid input we should not call report_fatal_error(), because when LLD is used as a library, we don't want to kill the whole app because of a malformed input. llvm-svn: 187673
* Use report_fatal_error() instead of llvm_unreachable() to show broken input ↵Rui Ueyama2013-08-021-1/+1
| | | | | | file error. llvm-svn: 187670
* [PECOFF] Remove an assertion that's too heavy.Rui Ueyama2013-08-021-6/+0
| | | | llvm-svn: 187665
* [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] A symbol with symbol with section number 0 and non-zero value ↵Rui Ueyama2013-08-021-0/+14
| | | | | | represents a BSS atom. llvm-svn: 187645
* [PECOFF] Simplify COFFBSSAtom.Rui Ueyama2013-08-022-5/+6
| | | | | | | A instance of the class always represents a BSS atom, so we don't need to look at the symbol or the section to retrieve its attributes. llvm-svn: 187643
* Use StringRef::equals_lower(). No functionality change.Rui Ueyama2013-07-311-2/+2
| | | | llvm-svn: 187548
* [PECOFF] Add a comment about .bss section.Rui Ueyama2013-07-311-0/+9
| | | | llvm-svn: 187505
* [PECOFF] Add a comment on the idata section fragments.Rui Ueyama2013-07-311-0/+19
| | | | llvm-svn: 187484
* Fix comment.Rui Ueyama2013-07-301-1/+1
| | | | llvm-svn: 187461
* [PECOFF] Emit BSS section.Rui Ueyama2013-07-302-5/+57
| | | | llvm-svn: 187460
* [PECOFF] Split COFFDefinedAtom to add COFFBSSAtom class.Rui Ueyama2013-07-302-22/+56
| | | | | | | | The BSS atom is similar to the regular defined atom, but it's different in the sense that it does not have contents. Until now we assumed all the defined atoms have its contents. That did not fit well to the BSS atom. llvm-svn: 187453
* [PECOFF] Process Import Name/Type field in the import library.Rui Ueyama2013-07-293-40/+91
| | | | | | | | This patch removes hacky mangle() function, which strips all decorations uncondtitionally. LLD now interprets Import Name/Type field in the import library properly as described in the Microsoft PE/COFF Spec. llvm-svn: 187388
* [PECOFF] Replace the magic number with sizeof().Rui Ueyama2013-07-291-5/+7
| | | | llvm-svn: 187382
* [PECOFF] Simplicy FileCOFF ctor. No functionality change.Rui Ueyama2013-07-281-73/+87
| | | | | | | | | Member functions to read the symbol table had too many parameters to propagate all the temporary information from one to another. By storing the information to data members, we can simplify the function signatures and improve the readability. llvm-svn: 187321
* Removed unnecessary parameter.Rui Ueyama2013-07-281-2/+1
| | | | llvm-svn: 187317
* [PECOFF] Skip a section if there's no atom in the section.Rui Ueyama2013-07-271-0/+7
| | | | | | | Some sections, such as with IMAGE_SCN_LNK_REMOVE attribute, is skipped in the first pass. Such sections need to be skipped in the latter passes. llvm-svn: 187281
* [PATCH] [PECOFF] Fill size field of IMAGE_DATA_DIRECTORYRui Ueyama2013-07-263-5/+13
| | | | | | Patch by Ron Ofir. llvm-svn: 187262
* [PECOFF][Driver] Add a library file even if it does not exist.Rui Ueyama2013-07-261-8/+8
| | | | | | | | Missing files will be reported as errors in the later pass, so this patch does not change the behavior of the LLD linker, but it helps writing unit tests for the driver. llvm-svn: 187256
* [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
* Make local variables to start with a lowercase character for consistency ↵Rui Ueyama2013-07-261-54/+54
| | | | | | with the LLD coding style. llvm-svn: 187215
* [PECOFF] Simplicy object allocation code. No functionality change.Rui Ueyama2013-07-262-20/+17
| | | | llvm-svn: 187214
* [PECOFF] Ignore sections with IMAGE_SCN_LNK_REMOVE attribute.Rui Ueyama2013-07-261-0/+5
| | | | llvm-svn: 187211
* [PECOFF] Create an atom for a symbol whose storage type is ↵Rui Ueyama2013-07-262-2/+5
| | | | | | IMAGE_SYM_CLASS_LABEL. llvm-svn: 187177
* [PECOFF] Add /include command line option.Rui Ueyama2013-07-241-0/+28
| | | | | | | | | | The /include command line option is equivalent to Unix --undefined option, which forces the linker to resolve the given symbol name as if it's an unresolved symbol in one of its input files. This feature is used to link an additional object file or a shared library that no input files refer to. llvm-svn: 187084
* [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] Replace magic numbers with offsetof().Rui Ueyama2013-07-221-4/+6
| | | | llvm-svn: 186888
* [PECOFF][Driver] Show error message if no input file is given.Rui Ueyama2013-07-221-0/+5
| | | | llvm-svn: 186882
* Rename ReaderCOFF members to follow the LLD coding style.Rui Ueyama2013-07-221-31/+31
| | | | llvm-svn: 186843
* [PECOFF] Fix use-after-free.Rui Ueyama2013-07-201-1/+1
| | | | llvm-svn: 186771
* [mach-o] factor out all cputype <-> arch conversions to one table driven ↵Nick Kledzik2013-07-201-28/+63
| | | | | | location llvm-svn: 186755
* [PECOFF][Driver] Add -base command line option.Rui Ueyama2013-07-201-4/+6
| | | | llvm-svn: 186739
* [PECOFF] Use library search path when looking for a .lib file.Rui Ueyama2013-07-191-0/+51
| | | | llvm-svn: 186645
OpenPOWER on IntegriCloud