summaryrefslogtreecommitdiffstats
path: root/lld/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [PECOFF] Do not create undefined atom for common symbol.Rui Ueyama2013-08-281-1/+2
| | | | | | | | We were creating undefined atoms for common symbols by mistake. That did not lead to a link failure, for undefined atoms would be resolved by common symbols in the same file, but that's a waste of resource. llvm-svn: 189534
* [PECOFF] Do not scan the symbol table twice but instead cache aux symbols.Rui Ueyama2013-08-281-14/+19
| | | | | | | | | We scanned the symbol table twice; first to gather all regular symbols, and second to process aux symbols. That's a bit inefficient and complicated. We can instead cache aux symbols in the first pass, to eliminate the need of the second pass. llvm-svn: 189525
* [PECOFF] Make command line options case insensitive to match link.exe's ↵Rui Ueyama2013-08-281-1/+5
| | | | | | behavior. llvm-svn: 189505
* Use do-while instead of a magic number. No functionality change.Rui Ueyama2013-08-271-3/+3
| | | | llvm-svn: 189413
* [PECOFF] Add the entry symbol and /include symbols to dead strip root set.Rui Ueyama2013-08-271-0/+9
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1527 llvm-svn: 189318
* Fix use of temporary strings.Rui Ueyama2013-08-271-4/+4
| | | | llvm-svn: 189310
* [PECOFF] Enable dead-stripping by default to match link.exe behavior.Rui Ueyama2013-08-272-0/+15
| | | | llvm-svn: 189308
* Treat entry point symbol as an undefined atom.Rui Ueyama2013-08-271-1/+1
| | | | | | | | | With this patch the entry symbol is treated as an undefined symbol, to force the resolver to resolve the entry symbol. Differential Revision: http://llvm-reviews.chandlerc.com/D1524 llvm-svn: 189307
* Rename ti -> ctx.Rui Ueyama2013-08-276-22/+23
| | | | | | | This should have been done in r187823 when I renamed LinkingContext from TargetInfo. I missed a few files. llvm-svn: 189298
* [PECOFF] Add Support for entry point symbol nameRui Ueyama2013-08-262-0/+48
| | | | | | Patch by Jesús Serrano García. llvm-svn: 189267
* [lld][ELF] Cleanup ELF writing, No change in functionalityShankar Easwaran2013-08-269-117/+85
| | | | | | | | | | The cleanup includes :- * Rename ambiguous Header class to ELFHeader * Convert Chunk contentype and kind to be a enumerated class * Remove functions that are not being used, avoids future confusion llvm-svn: 189209
* [lld][ELF] Indent the td file to < 80 columnsShankar Easwaran2013-08-261-14/+30
| | | | llvm-svn: 189207
* [lld][ELF][Cleanup] Create multiclass for variations in options usageShankar Easwaran2013-08-252-11/+12
| | | | llvm-svn: 189197
* [lld][ELF] process fini_array sectionsShankar Easwaran2013-08-253-1/+6
| | | | | | | | This change processes fini_array section in addition to processing init_array sections. This also makes functions registered at compile time for initialization and finalization to be run during execution llvm-svn: 189196
* [PECOFF] support additional subsystem identifiersSaleem Abdulrasool2013-08-241-0/+10
| | | | | | | | | This completes the subsystem name parsing to support the identifiers that the Microsoft link.exe linker supports. "windows" and "console" are left as the first items as they are the expected common paths. Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> llvm-svn: 189181
* Separates /fixed (no .reloc section) and /dynamicbase (enable ASLR)Rui Ueyama2013-08-243-1/+17
| | | | | | | | in order to match link.exe's behaviour. Patch by Ron Ofir. llvm-svn: 189159
* Fixes an additional temporary string use.Rui Ueyama2013-08-231-1/+1
| | | | | | Patch by Ron Ofir. llvm-svn: 189151
* [lld][ELF] Dont ignore zero sized sections.Shankar Easwaran2013-08-231-3/+1
| | | | | | | | There may be relocations that may be pointing to the section even if the section sizes are 0. We shouldnot ignore them for that regard. llvm-svn: 189139
* [lld][ELF][Cleanup] Section associated with the relocation traversedShankar Easwaran2013-08-231-10/+6
| | | | | | | There is no change in functionality, this uses the defined way to access the relocation section that belongs to a particular section. llvm-svn: 189138
* [lld][ELF] Rename typeTLV content type for ELFShankar Easwaran2013-08-235-12/+18
| | | | | | | | | | | typeTLV content type is used by Darwin to represent thread local storage. A new contentType has to be made to represent ELF thread local storage data. These have been set to - typeThreadZeroFill (represents TBSS storage) - typeThreadData (represents TDATA storage) llvm-svn: 189137
* [lld] handle typeZeroFill atoms in ELF/Native/YAMLShankar Easwaran2013-08-236-11/+17
| | | | | | | | | | | | | BSS atoms dont take any file space in the Input file. They are associated with a contentType(typeZeroFill). Similiar zero fill types also exist which have the same meaning in terms of occupying file space in the Input. These atoms have to be handled seperately when writing to the lld's intermediate file or the lld test infrastructure. Also adds a test. llvm-svn: 189136
* [lld][PECOFF] Fix one more reference to a temporary stringShankar Easwaran2013-08-221-1/+1
| | | | llvm-svn: 189035
* [lld][PECOFF] Fix use of temporary stringsShankar Easwaran2013-08-222-3/+2
| | | | llvm-svn: 189025
* [lld][Hexagon] Enable Hexagon sdata sorting testShankar Easwaran2013-08-221-1/+8
| | | | llvm-svn: 188981
* remove trailing whitespaceShankar Easwaran2013-08-222-5/+5
| | | | llvm-svn: 188965
* [lld][Darwin] fixing an accidentally removed changeShankar Easwaran2013-08-211-0/+10
| | | | llvm-svn: 188963
* [lld] Fix win7 failure on adding InputGraph functionalityShankar Easwaran2013-08-211-2/+2
| | | | llvm-svn: 188961
* add InputGraph functionalityShankar Easwaran2013-08-2114-1202/+600
| | | | llvm-svn: 188958
* [PECOFF] Handle "--" option explicitlyHans Wennborg2013-08-132-0/+10
| | | | | | | | | This used to be handled automagically by the option parsing library, but after LLVM r188314, we should handle it ourselves. No functionality change, but adds a test. llvm-svn: 188318
* [PECOFF] Treat the common symbol as mergeable symbol.Rui Ueyama2013-08-132-9/+23
| | | | | | | This is a temporary measure because the semantics of the common symbol is actually more compilcated than the simple mergeable symbol. llvm-svn: 188235
* [PECOFF] Fixed base images now have the IMAGE_FILE_RELOCS_STRIPPED flagRui Ueyama2013-08-121-0/+3
| | | | | | Patch by Ron Ofir. llvm-svn: 188187
* [PECOFF] Trim at most one character from imported symbols.Rui Ueyama2013-08-121-2/+10
| | | | | | | | | | | | | | The import name is not always the same as the symbol name. If the name/type field in the import header is NOPREFIX or UNDECORATE, we need to strip some characters from symbol to get its import name. The Microsoft PE/COFF spec is vague if symbol contains more than two consecutive characters to be stripped. We used to strip all characters, but it doesn't seem right as we couldn't link against the system library because of this name mangling. Looks like we shouldn't strip more than one character. llvm-svn: 188154
* 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-092-2/+2
| | | | 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-0682-1363/+1191
| | | | | | | | | 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 special treatment of "--" option.Rui Ueyama2013-08-021-20/+1
| | | | | | | Thanks to Hans' patch (r187675), OptTable now handles "--", so we don't need this code in LLD. llvm-svn: 187683
* [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
OpenPOWER on IntegriCloud