summaryrefslogtreecommitdiffstats
path: root/lld/lib/Core
Commit message (Collapse)AuthorAgeFilesLines
* Add a fallback mechanism for undefined atom.Rui Ueyama2013-09-122-2/+18
| | | | | | | | | | | | | | | | | In COFF, an undefined symbol can have up to one alternative name. If a symbol is resolved by its regular name, then it's linked normally. If a symbol is not found in any input files, all references to the regular name are resolved using the alternative name. If the alternative name is not found, it's a link error. This mechanism is called "weak externals". To support this mechanism, I added a new member function fallback() to undefined atom. If an undefined atom has the second name, fallback() returns a new undefined atom that should be used instead of the original one to resolve undefines. If it does not have the second name, the function returns nullptr. Differential Revision: http://llvm-reviews.chandlerc.com/D1550 llvm-svn: 190625
* Drop the context forceLoadAllArchives() support. Rename the isForceLoadJoerg Sonnenberger2013-09-081-1/+1
| | | | | | | | | attribute in LinkerInput to isWholeArchive and use that for deciding whether library archives should be expanded. Implement the -all_load option of the Darwin linker using this flag and drop the support for it in GNU mode. llvm-svn: 190275
* Change the parseFile argument from MemoryBuffer pointer to LinkerInputJoerg Sonnenberger2013-09-071-11/+0
| | | | | | reference. Move readFile logic into FileNode::createLinkerInput. llvm-svn: 190253
* [lld][ELF] Differentiate between Note sections(RW/RO)Shankar Easwaran2013-09-041-1/+2
| | | | | | | | | | It looks like there is a possibility of seeing RO/RW note sections and we would need to create an appropriate RO/RW segment associated with them. Adds a test too. llvm-svn: 189907
* [lld][ELF] Emit note sectionsShankar Easwaran2013-09-041-0/+1
| | | | | | | | Emit note sections if the input contains a note section. Also emit a note segment. llvm-svn: 189896
* Resolver: Do not use assert() to notify user input error.Rui Ueyama2013-09-031-1/+5
| | | | llvm-svn: 189775
* [lld][LinkingContext] Atoms created from command line options should be ↵Shankar Easwaran2013-08-311-0/+35
| | | | | | | | | | | | available in YAML This adds an API to the LinkingContext for flavors to add Internal files containing atoms that need to appear in the YAML output as well, when -emit-yaml switch is used. Flavors can add more internal files for other options that are needed. llvm-svn: 189718
* Use do-while instead of a magic number. No functionality change.Rui Ueyama2013-08-271-3/+3
| | | | llvm-svn: 189413
* [lld][ELF] Rename typeTLV content type for ELFShankar Easwaran2013-08-231-0/+2
| | | | | | | | | | | 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
* Fix spelling error. s/Libary/Library/g.Rui Ueyama2013-08-091-1/+1
| | | | llvm-svn: 188049
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-064-33/+32
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* fix typo in error stringNick Kledzik2013-07-231-1/+1
| | | | llvm-svn: 186996
* [PECOFF] Support linking against DLL.Rui Ueyama2013-07-111-0/+1
| | | | | | | | | | | | | | | 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
* Removed unnecessary "class" keyword.Rui Ueyama2013-06-211-1/+1
| | | | llvm-svn: 184589
* Factor duplicated yamlReader creation.Rafael Espindola2013-06-111-0/+5
| | | | | | | | | | | The yaml reader is not specific to any file format. This patch moves it to TargetInfo and makes validate a non virtual interface so that it can be constructed from a single location. The same method will be used to create a reader for llvm bitcode files. llvm-svn: 183740
* Instrument things.Michael J. Spencer2013-05-282-1/+8
| | | | llvm-svn: 182789
* [lld] Use range based for loop instead of explicit iterators (no ↵Rui Ueyama2013-05-091-3/+2
| | | | | | functionality change) llvm-svn: 181503
* [lld] Add comments to InputFiles::searchLibraries() arguments.Rui Ueyama2013-05-081-4/+11
| | | | llvm-svn: 181492
* Use anonymous namespace for local classes. Patch by Rui UeyamaNick Kledzik2013-05-081-2/+6
| | | | llvm-svn: 181473
* [Core] Allow weak symbols in shared library when linking.Michael J. Spencer2013-04-241-11/+13
| | | | | | Patch by Rui Ueyama. llvm-svn: 180209
* This adds functionality for undefined atoms from dynamic libraries to be addedShankar Easwaran2013-04-112-25/+27
| | | | | | | | | | | | to the list of undefined atoms. The processing of undefined atoms from dynamic libraries is controlled by use-shlib-undefines command line option. This patch also adds additional command line arguments to allow/disallow unresolved symbols from shared libraries and mimics GNU ld behavior. llvm-svn: 179257
* Add VTune as an optional external dependency and add task tracking.Michael J. Spencer2013-04-061-0/+2
| | | | llvm-svn: 178940
* Revert "Correctly pass ownership of MemoryBuffers."Michael J. Spencer2013-04-051-1/+2
| | | | llvm-svn: 178918
* Correctly pass ownership of MemoryBuffers.Michael J. Spencer2013-04-051-3/+2
| | | | llvm-svn: 178914
* Fix uninitialized variables. Found by ubsan.Michael J. Spencer2013-04-051-0/+1
| | | | llvm-svn: 178913
* This is my Driver refactoring patch. Nick Kledzik2013-04-043-42/+66
| | | | | | | | | | | | | | | | | | | | | | | The major changes are: 1) LinkerOptions has been merged into TargetInfo 2) LinkerInvocation has been merged into Driver 3) Drivers no longer convert arguments into an intermediate (core) argument list, but instead create a TargetInfo object and call setter methods on it. This is only how in-process linking would work. That is, you can programmatically set up a TargetInfo object which controls the linking. 4) Lots of tweaks to test suite to work with driver changes 5) Add the DarwinDriver 6) I heavily doxygen commented TargetInfo.h Things to do after this patch is committed: a) Consider renaming TargetInfo, given its new roll. b) Consider pulling the list of input files out of TargetInfo. This will enable in-process clients to create one TargetInfo the re-use it with different input file lists. c) Work out a way for Drivers to format the warnings and error done in core linking. llvm-svn: 178776
* [SymbolTable][Perf] Use hash_combine instead of a custom hash, also use memcmp.Michael J. Spencer2013-03-201-14/+9
| | | | | | | | | | ArrayRef<uint8_t>::equals(); lowers to a byte compare loop :(. TODO: Figure out if we are getting hash collisions, or just have a lot of equal content. Also test if crypto hashing the content instead of full compare is better. llvm-svn: 177588
* [lld] remove trailing whitespaceShankar Easwaran2013-03-144-11/+11
| | | | llvm-svn: 177079
* Add basic linker script parsing.Michael J. Spencer2013-03-011-6/+28
| | | | llvm-svn: 176309
* [ELF][Hexagon]add typeZeroFillFastShankar Easwaran2013-02-241-0/+1
| | | | llvm-svn: 175983
* add changes for typeDataFastShankar Easwaran2013-02-221-0/+1
| | | | llvm-svn: 175901
* [Resolver] Improve undefined symbol error.Michael J. Spencer2013-02-031-1/+2
| | | | llvm-svn: 174277
* [Core] Only complain about undefined symbols if they are marked as ↵Michael J. Spencer2013-01-312-9/+13
| | | | | | canBeNullNever. llvm-svn: 174107
* Add SectionPosition and OrderPassNick Kledzik2013-01-234-3/+34
| | | | llvm-svn: 173300
* Add PassManager.Michael J. Spencer2013-01-232-0/+24
| | | | | | It owns and manages passes. llvm-svn: 173287
* [Core] Move Resolver and SymbolTable over to TargetInfo.Michael J. Spencer2013-01-222-20/+25
| | | | | | No functionality change. llvm-svn: 173192
* Add {,ELF,MachO}TargetInfo.Michael J. Spencer2013-01-222-0/+36
| | | | llvm-svn: 173117
* Add new merge-by-content Merge attribute for use by anonymousNick Kledzik2013-01-152-8/+13
| | | | | | constants and string literals which the linker should coalesce. llvm-svn: 172495
* Better tie together ContentType and Permissions. Nick Kledzik2013-01-092-0/+79
| | | | | | | | | | Since most content types (e.g. typeCode) have a preferred Permission, add a function to do that mapping. Then hook up to YAML Reader and Writer such that the 'permissions:' key does not need to be specified unless overriding what the content type prefers. llvm-svn: 171929
* fix typoNick Kledzik2013-01-081-1/+1
| | | | llvm-svn: 171916
* Removes files for separate ReaderYAML.cpp and WriterYAML.cpp Nick Kledzik2013-01-051-0/+6
| | | | | | | | and adds a new file ReaderWriterYAML.cpp that uses YAML I/O. Lots of tweaks to test suite for slightly different YAML encoding. llvm-svn: 171592
* Style fixes.Michael J. Spencer2013-01-041-9/+0
| | | | llvm-svn: 171531
* Slightly better diagnostics on duplicate symbols.Michael J. Spencer2013-01-041-0/+9
| | | | llvm-svn: 171528
* Add library dependencies to the lld cmake build.Benjamin Kramer2012-12-041-0/+2
| | | | llvm-svn: 169306
* Add absolute symbol scope recognition in lld/CoreHemant Kulkarni2012-11-051-1/+3
| | | | llvm-svn: 167394
* use llvm_unreachable() instead of assert(0) for invalid enum values in ↵Nick Kledzik2012-06-151-1/+1
| | | | | | switch statements llvm-svn: 158542
* Major refactoring: Remove Platform concept. In its place there are Nick Kledzik2012-05-3112-3895/+53
| | | | | | | | now Reader and Writer subclasses for each file format. Each Reader and Writer subclass defines an "options" class which controls how that Reader or Writer operates. llvm-svn: 157774
* Remove some compilation warnings.Filipe Cabecinhas2012-05-221-1/+1
| | | | llvm-svn: 157253
* remove completed itemsNick Kledzik2012-05-041-8/+0
| | | | llvm-svn: 156143
* Rework how YAMLReader is layered on top of YAMLParser. Turn hand writtenNick Kledzik2012-05-035-615/+854
| | | | | | | | recursive descent functions into one table driven parser. Add proper error recovery and reporting. Add lots of test cases with semantics errors and verify error messages. llvm-svn: 156136
OpenPOWER on IntegriCloud