summaryrefslogtreecommitdiffstats
path: root/lld/unittests
Commit message (Collapse)AuthorAgeFilesLines
...
* Rename path() -> getPath().Rui Ueyama2013-10-081-2/+1
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1853 llvm-svn: 192167
* fix all EXPECT_EQ(.address) testsNick Kledzik2013-10-081-8/+8
| | | | llvm-svn: 192153
* fix test case failing on botNick Kledzik2013-10-081-1/+1
| | | | llvm-svn: 192152
* Supoort mach-o encoded in yaml.Nick Kledzik2013-10-083-0/+779
| | | | | | | | | | | | | | | | | | | | | This is the first step in how I plan to get mach-o object files support into lld. We need to be able to test the mach-o Reader and Write on systems without a mach-o tools. Therefore, we want to support a textual way (YAML) to represent mach-o files. MachONormalizedFile.h defines an in-memory abstraction of the content of mach-o files. The in-memory data structures are always native endianess and always use 64-bit sizes. That internal data structure can then be converted to or from three different formats: 1) yaml (text) encoded mach-o, 2) binary mach-o files, 3) lld Atoms. This patch defines the internal model and uses YAML I/O to implement the conversion to and from the model to yaml. The next patch will implement the conversion from normalized to binary mach-o. This patch includes unit tests to validate the yaml conversion APIs. llvm-svn: 192147
* [lld][InputGraph] Change the Resolver to use inputGraphShankar Easwaran2013-10-071-2/+1
| | | | | | | | | | | | 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
* [mach-o] Add support for -mllvm to darwin driverNick Kledzik2013-09-281-0/+9
| | | | llvm-svn: 191594
* [mach-o] switch to use llvm::MachO:: constantsNick Kledzik2013-09-271-16/+17
| | | | | | Stop using some locally defined mach-o constants. llvm-svn: 191581
* [PECOFF] Enable input file logging if /debug is given.Rui Ueyama2013-09-261-0/+2
| | | | llvm-svn: 191469
* Make Driver::link and LinkingContext::validate return true on success.Rui Ueyama2013-09-243-112/+111
| | | | | | | | | | | | | This patch inverts the return value of these functions, so that they return "true" on success and "false" on failure. The meaning of boolean return value was mixed in LLD; for example, InputGraph::validate() returns true on success. With this patch they'll become consistent. CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1748 llvm-svn: 191341
* [PECOFF] Ignore /verbose and /wx (warnings as errors) options.Rui Ueyama2013-09-241-1/+2
| | | | llvm-svn: 191317
* [PECOFF] Add /swaprun:{cd,net} options.Rui Ueyama2013-09-241-0/+12
| | | | llvm-svn: 191276
* [PECOFF] Ignore /pdbaltpath option.Rui Ueyama2013-09-241-1/+2
| | | | | | | | /PDBALTPATH:<path> is an option to embed a different path for the PDB file to the binary than the actual PDB file location. Because we don't support PDB file, we'll just ignore the option for now. llvm-svn: 191273
* [PECOFF] Ignore /pdb option.Rui Ueyama2013-09-241-1/+1
| | | | llvm-svn: 191269
* [PECOFF] Ignore /debug option.Rui Ueyama2013-09-241-0/+5
| | | | llvm-svn: 191268
* Try to fix test failure on buildbot.Rui Ueyama2013-09-241-1/+1
| | | | llvm-svn: 191259
* [PECOFF] Add /nodefaultlib command line option.Rui Ueyama2013-09-241-9/+30
| | | | llvm-svn: 191254
* [PECOFF] Do not allow space to separate command line option and its value.Rui Ueyama2013-09-231-3/+3
| | | | | | | | | | | | | | | We used to support both Windows and Unix style command line options. In Windows style, an option and its value are separated by ":" (colon). In Unix, separator is a space. Accepting both styles were convenient, but we can no longer allow Unix style because I found that can be ambiguous. For example, /nodefaultlib option takes an optional argument. In Windows style it's going to be something like "/nodefaultlib:foo". There's no ambiguity what "foo" means. However, if the option is "/nodefaultlib foo", "foo" can be interpreted either an optional argument for "/nodefaultlib" or an input file "foo.obj". We should just stop accepting the non-standard command line style. llvm-svn: 191247
* [PECOFF] Ignore /delay and /delayload options.Rui Ueyama2013-09-231-1/+2
| | | | | | | | | | | | | | | | These options are to enable DLL delay loading. If enabled, DLL is loaded at run time by a helper routine when a function in the DLL is actually called for the first time, instead of making the Windows loader to load all DLLs at startup time. This should shorten startup delay if an executable have many imported symbols. The linker needs to create a "delayed import table" and link delayimp.lib in which helper functions are defined to support the feature. For now, we just ignore the options, so that the linker does not complain when it sees these options. We want to support them in the future. llvm-svn: 191232
* [PECOFF] Add more tests for /machine, /base, /stack, /heap and /align.Rui Ueyama2013-09-231-0/+29
| | | | llvm-svn: 191229
* [PECOFF] Add comments to unit tests and reorder them if necessary.Rui Ueyama2013-09-231-13/+41
| | | | llvm-svn: 191228
* [PECOFF] Add /allowisolation command line option.Rui Ueyama2013-09-231-0/+11
| | | | llvm-svn: 191227
* [PECOFF] Add /allowbind command line option.Rui Ueyama2013-09-231-0/+11
| | | | llvm-svn: 191224
* [PECOFF] Add /align command line option.Rui Ueyama2013-09-231-0/+6
| | | | llvm-svn: 191218
* [lld][LinkingContext][ELF] Allow different output file types.Shankar Easwaran2013-09-231-3/+5
| | | | | | | | | | This adds an option --output-filetype that can be set to either YAML/Native(case insensitive). The linker would create the outputs associated with the type specified by the user. Changes all the tests to use the new option. llvm-svn: 191183
* [PECOFF] Ignore /incremental option.Rui Ueyama2013-09-201-2/+2
| | | | | | | | | /incremental is an option to enable incremental linking. We will eventually want to implement the feature for better performance, but in the meantime, we want to just ignore the option so that the linker does not output unknown option error when it sees /incremental option. llvm-svn: 191063
* [PECOFF] Ignore /errorReport command line option.Rui Ueyama2013-09-191-3/+5
| | | | | | | | /errorReport is a command line option to let the linker to report internal linker error information to Microsoft. For LLD that option doesn't make any sense, so it just ignores the option. llvm-svn: 191044
* [PECOFF][Driver] Support /version command line optionRui Ueyama2013-09-191-0/+12
| | | | llvm-svn: 190986
* [PECOFF] Add a field for machine type to PECOFFLinkingContext.Rui Ueyama2013-09-121-5/+2
| | | | | | | | | 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
* Remove hard-coded leading underscore from entry symbol.Rui Ueyama2013-09-121-1/+1
| | | | llvm-svn: 190586
* Support darwin linker options: Nick Kledzik2013-09-101-0/+52
| | | | | | | | -current_version, -compatibility_version, and -install_name. Patch by Joe Ranieri llvm-svn: 190452
* Drop the context forceLoadAllArchives() support. Rename the isForceLoadJoerg Sonnenberger2013-09-081-10/+0
| | | | | | | | | 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-1/+1
| | | | | | reference. Move readFile logic into FileNode::createLinkerInput. llvm-svn: 190253
* [PECOFF] Add /machine command line option.Rui Ueyama2013-09-061-0/+8
| | | | llvm-svn: 190121
* [lld] handle the case of errors from createLinkerInputShankar Easwaran2013-09-031-1/+2
| | | | | | | | | | This changes the interface of createLinkerInput to use ErrorOr, so that errors from the linker can be captured. Also adds a convenience function for error strings to be returned from file nodes. llvm-svn: 189871
* [lld][LinkingContext] Atoms created from command line options should be ↵Shankar Easwaran2013-08-311-2/+0
| | | | | | | | | | | | 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
* [PECOFF] Add /force:unresolved command line option as a synonym of /force.Rui Ueyama2013-08-291-0/+5
| | | | llvm-svn: 189614
* [PECOFF] Make command line options case insensitive to match link.exe's ↵Rui Ueyama2013-08-281-0/+9
| | | | | | behavior. llvm-svn: 189505
* [PECOFF] Enable dead-stripping by default to match link.exe behavior.Rui Ueyama2013-08-271-0/+1
| | | | llvm-svn: 189308
* Treat entry point symbol as an undefined atom.Rui Ueyama2013-08-271-1/+2
| | | | | | | | | 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
* [PECOFF] Add Support for entry point symbol nameRui Ueyama2013-08-261-0/+10
| | | | | | Patch by Jesús Serrano García. llvm-svn: 189267
* Separates /fixed (no .reloc section) and /dynamicbase (enable ASLR)Rui Ueyama2013-08-241-0/+12
| | | | | | | | in order to match link.exe's behaviour. Patch by Ron Ofir. llvm-svn: 189159
* [lld][unittests] Change assert to llvm_unreachableShankar Easwaran2013-08-221-2/+1
| | | | llvm-svn: 189023
* [lld][test] fix -Wreturn-type errorShankar Easwaran2013-08-221-0/+1
| | | | llvm-svn: 188988
* add InputGraph functionalityShankar Easwaran2013-08-212-3/+6
| | | | llvm-svn: 188958
* [PECOFF] Handle "--" option explicitlyHans Wennborg2013-08-131-0/+11
| | | | | | | | | 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
* Rename TargetInfo -> LinkingContext.Rui Ueyama2013-08-065-132/+124
| | | | | | | | | Also change some local variable names: "ti" -> "context" and "_targetInfo" -> "_context". Differential Revision: http://llvm-reviews.chandlerc.com/D1301 llvm-svn: 187823
* Revert "[PECOFF][Driver] Remove quotes from command line arguments."Rui Ueyama2013-07-311-11/+1
| | | | | | | | | | | | | | | This reverts commit r187390 because we should not handle argv's quotes ourselves. In Windows, unlike Unix, quotes are not processed by the shell. Instead the C startup routine parses it as described in http://msdn.microsoft.com/en-us/library/a1y7w461.aspx and pass the results to main(). So, at the time when the control reaches main(), quotes that should be removed has already been removed. We still need to handle quotes in the response file and in .drectve section ourselves. That will be addressed in different patches. llvm-svn: 187534
* [PECOFF][Driver] Remove quotes from command line arguments.Rui Ueyama2013-07-291-1/+11
| | | | | | | The command line option in .drectve section may be quoted by double quotes, and if that's the case we have to remove them. llvm-svn: 187390
* [PECOFF][Driver] Add ".lib" extension to the path given with /defaultlib.Rui Ueyama2013-07-261-2/+4
| | | | llvm-svn: 187259
* [PECOFF][Driver] Add a library file even if it does not exist.Rui Ueyama2013-07-261-0/+7
| | | | | | | | 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
OpenPOWER on IntegriCloud