summaryrefslogtreecommitdiffstats
path: root/lld/lib/Driver/GnuLdDriver.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement semantic action for SEARCH_DIR linker script commandRafael Auler2015-01-311-2/+7
| | | | | | | | | | | | This is needed, among others by the FreeBSD kernel linker script. Patch by Davide Italiano! Reviewers: ruiu, rafaelauler Differential Revision: http://reviews.llvm.org/D7220 llvm-svn: 227694
* ELF: Fix a bug in -l.Rui Ueyama2015-01-301-1/+1
| | | | | | | If a linker script is given with -l, LLD failed to read the file. The bug was introduced in 227341. llvm-svn: 227610
* ELF: s/diagnostics/diag/Rui Ueyama2015-01-281-33/+27
| | | | | | | We use a variable name "diag" in many other places and I think it's preferred because of its length. llvm-svn: 227369
* ELF: add a unit test for --as-needed.Rui Ueyama2015-01-281-1/+3
| | | | llvm-svn: 227367
* Add a unit test for LinkerScript.Rui Ueyama2015-01-281-13/+21
| | | | llvm-svn: 227341
* Remove PPC ELF targetGreg Fitzgerald2015-01-281-1/+0
| | | | | | Differential Revision: http://reviews.llvm.org/D7225 llvm-svn: 227320
* [Mips] Teach LLD to recognize one more MIPS target triple - mips64elSimon Atanasyan2015-01-251-0/+3
| | | | | | | | | | | | This is initial patch to support MIPS64 object files linking. The patch just makes some classes more generalized, and rejects attempts to interlinking O32 and N64 ABI object files. I try to reuse the current MIPS target related classes as much as possible because O32 and N64 MIPS ABI are tightly related and share almost the same set of relocations, GOT, flags etc. llvm-svn: 227058
* Fix single-arch builds broken by r226976Greg Fitzgerald2015-01-241-0/+1
| | | | | | TODO: Move ELF/PPC to ELF/PowerPC TODO: Move ELF/X86_64 into ELF/X86 llvm-svn: 226989
* Fix the ELF shared library build targets - take 2Greg Fitzgerald2015-01-241-1/+19
| | | | | | | | | | lldELF is used by each ELF backend. lldELF's ELFLinkingContext also held a reference to each backend, creating a link-time cycle. This patch moves the backend references to lldDriver. Differential Revision: http://reviews.llvm.org/D7119 llvm-svn: 226976
* Fix spelling.Rui Ueyama2015-01-231-1/+1
| | | | llvm-svn: 226966
* Revert " Fix the ELF shared library build targets"Greg Fitzgerald2015-01-231-31/+1
| | | | | | This reverts commit 6a3f545b44cea46321e025d9ab773786af86cb51. llvm-svn: 226928
* Fix the ELF shared library build targetsGreg Fitzgerald2015-01-231-1/+31
| | | | | | | | | | lldELF is used by each ELF backend. lldELF's ELFLinkingContext also held a reference to each backend, creating a link-time cycle. This patch moves the backend references to lldDriver. Differential Revision: http://reviews.llvm.org/D7119 llvm-svn: 226922
* [ELF] Minimal implementation for ARM static linkingGreg Fitzgerald2015-01-211-0/+4
| | | | | | | | | | | | | | The code is able to statically link the simplest case of: int main() { return 0; } * Only works with ARM code - no Thumb code, no interwork (-marm -mno-thumb-interwork) * musl libc built with no interwork and no Thumb code Differential Revision: http://reviews.llvm.org/D6716 From: Denis Protivensky <dprotivensky@accesssoftek.com> llvm-svn: 226643
* Fix use after free.Rafael Espindola2015-01-201-1/+1
| | | | | | | This fixes running a few tests (including test/elf/Mips/e-flags-merge-1.test) under asan. llvm-svn: 226580
* Update comments.Rui Ueyama2015-01-171-1/+1
| | | | llvm-svn: 226380
* Split a function for readability.Rui Ueyama2015-01-161-26/+30
| | | | llvm-svn: 226292
* Simplify. No functionality change.Rui Ueyama2015-01-161-9/+4
| | | | llvm-svn: 226287
* [ELF] Add --as-needed.Rui Ueyama2015-01-161-4/+6
| | | | | | | | | | | | The previous default behavior of LLD is --as-needed. LLD linked against a DSO only if the DSO file was actually used to link an executable (i.e. at least one symbol was resolved using the shared library file.) In this patch I added a boolean flag to FileNode for --as-needed. I also added an accessor to DSO name to shared library file class. llvm-svn: 226274
* Simplify.Rui Ueyama2015-01-151-6/+3
| | | | llvm-svn: 226225
* [ELF] Do not error on non-existent file in the driver.Rui Ueyama2015-01-151-2/+4
| | | | | | | This change makes it easy to write unit tests for the GNU driver. No more "empty group" hack is needed. No change in functionality. llvm-svn: 226150
* Remove InputGraph and use std::vector<Node> instead.Rui Ueyama2015-01-151-12/+8
| | | | | | In total we have removed more than 1000 lines! llvm-svn: 226149
* Rename InputElement Node.Rui Ueyama2015-01-151-2/+2
| | | | | | | | | InputElement was named that because it's an element of an InputGraph. It's losing the origin because the InputGraph is now being removed. InputElement's subclass is FileNode, that naming inconsistency needed to be fixed. llvm-svn: 226147
* Remove InputGraph::addInputElement{,Front}.Rui Ueyama2015-01-151-4/+4
| | | | | | | | They were the last member functions of InputGraph (besides members()). Now InputGraph is just a container of a vector. We are ready to replace InputGraph with plain File vector. llvm-svn: 226146
* Remove WrapperNode.Rui Ueyama2015-01-151-3/+2
| | | | | | | WrapperNode was a useless subclass of FileNode. We should just use FileNode instead. llvm-svn: 226145
* Remove InputGraph::size().Rui Ueyama2015-01-151-1/+1
| | | | llvm-svn: 226140
* Re-commit r225766, r225767, r225769, r225814, r225816, r225829, and r225832.Rui Ueyama2015-01-151-3/+0
| | | | | | | These changes depended on r225674 and had been rolled back in r225859. Because r225674 has been re-submitted, it's safe to re-submit them. llvm-svn: 226132
* Attempt to fix a Linux buildbot.Rui Ueyama2015-01-151-1/+1
| | | | llvm-svn: 226127
* Re-commit r225674: Convert other drivers to use WrapperNode.Rui Ueyama2015-01-151-56/+85
| | | | | | | | The original commit had an issue with Mac OS dylib files. It didn't handle fat binary dylib files correctly. This patch includes a fix. A test for that case has already been committed in r225764. llvm-svn: 226123
* Revert "Convert other drivers to use WrapperNode" and subsequent commits.Rui Ueyama2015-01-141-85/+59
| | | | | | | r225764 broke a basic functionality on Mac OS. This change reverts r225764, r225766, r225767, r225769, r225814, r225816, r225829, and r225832. llvm-svn: 225859
* Remove InputGraph::dump().Rui Ueyama2015-01-131-3/+0
| | | | | | This is dead code. llvm-svn: 225766
* Convert other drivers to use WrapperNode.Rui Ueyama2015-01-131-56/+85
| | | | llvm-svn: 225764
* [ELF] Remove {ELF,}GNULinkerScript.Rui Ueyama2015-01-071-8/+57
| | | | | | | | | | | | | | | | | | | | Instead of representing a linker script file as an "InputElement", parse and evaluate scripts in the driver as we see them. Linker scripts are not regular input files (regular file is one of object, archive, or shared library file). They are more like extended command line options. Linker script handling was needlessly complicated because of that inappropriate abstraction (besides excessive class hierarchy -- there is no such thing like ELF linker script but we had two classes there for some reason.) LinkerScript was one of a few remaining InputElement subclasses that can be expanded to multiple files. With this patch, we are one step closer to retire InputElement. http://reviews.llvm.org/D6648 llvm-svn: 225330
* Replace ReaderError with DynamicError.Rui Ueyama2014-12-151-2/+1
| | | | | | | | | ReaderErrorCategory was used only at one place. We now have a DynamicErrorCategory for this kind of one-time error, so use it. The calling function doesn't really care the type of an error, so ReaderErrorCategory was actually dead code. llvm-svn: 224245
* [ELF] Clean up OPT_INPUT handler. NFC.Rui Ueyama2014-12-131-33/+31
| | | | llvm-svn: 224192
* Move definitions to the correct file.Rui Ueyama2014-12-131-15/+0
| | | | llvm-svn: 224190
* [ELF] Make -init/-fini options compatible with the gnu linkerSimon Atanasyan2014-12-101-2/+2
| | | | | | | | | | | | | | The LLD linker searches initializer and finalizer function names and emits DT_INIT/DT_FINI dynamic table tags to point to these symbols. The -init/-fini command line options override initializer ("_init") and finalizer ("_fini") function names used by default. Now the -init/-fini options do not affect .init_array/.fini_array sections. The corresponding code has been removed. Differential Revision: http://reviews.llvm.org/D6578 llvm-svn: 223917
* Re-commit r223330: Rewrite InputGraph's GroupRui Ueyama2014-12-101-12/+15
| | | | llvm-svn: 223867
* Revert "Rewrite InputGraph's Group"Rui Ueyama2014-12-041-15/+12
| | | | | | | | This reverts commit r223330 because it broke Darwin and ELF linkers in a way that we couldn't have caught with the existing test cases. llvm-svn: 223373
* Rewrite InputGraph's GroupRui Ueyama2014-12-041-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The aim of this patch is to reduce the excessive abstraction from the InputGraph. We found that even a simple thing, such as sorting input files (Mach-O) or adding a new file to the input file list (PE/COFF), is nearly impossible with the InputGraph abstraction, because it hides too much information behind it. As a result, we invented complex interactions between components (e.g. notifyProgress() mechanism) and tricky code to work around that limitation. There were many occasions that we needed to write awkward code. This patch is a first step to make it cleaner. As a first step, this removes Group class from the InputGraph. The grouping feature is now directly handled by the Resolver. notifyProgress is removed since we no longer need that. I could have cleaned it up even more, but in order to keep the patch minimum, I focused on Group. SimpleFileNode class, a container of File objects, is now limited to have only one File. We shold have done this earlier. We used to allow putting multiple File objects to FileNode. Although SimpleFileNode usually has only one file, the Driver class actually used that capability. I modified the Driver class a bit, so that one FileNode is created for each input File. We should now probably remove SimpleFileNode and directly store File objects to the InputGraph in some way, because a container that can contain only one object is useless. This is a TODO. Mach-O input files are now sorted before they are passe to the Resolver. DarwinInputGraph class is no longer needed, so removed. PECOFF still has hacky code to add a new file to the input file list. This will be cleaned up in another patch. llvm-svn: 223330
* [ELF] Fix conditions for max-page-size.Shankar Easwaran2014-11-131-1/+1
| | | | | | Fix comments from Rui, also adds a test. llvm-svn: 221860
* [ELF] Fix max-page-size option.Shankar Easwaran2014-11-131-2/+1
| | | | | | | | | | The user can use the max-page-size option and set the maximum page size. Dont check for maximum allowed values for page size, as its what the kernel is configured with. Fix the test as well. llvm-svn: 221858
* [Gnu][Driver] Use StringRef conversion functionsShankar Easwaran2014-11-111-13/+7
| | | | llvm-svn: 221648
* [Gnu] Support --image-base optionShankar Easwaran2014-11-101-0/+13
| | | | | | The value for --image-base is used as the base address of the program. llvm-svn: 221589
* [ELF] Support -z max-page-size optionShankar Easwaran2014-11-101-1/+36
| | | | | | | The GNU linker allows the user to change the page size by using the option -z max-page-size. llvm-svn: 221584
* [ELF] Support --no-align-segments.Shankar Easwaran2014-11-081-0/+4
| | | | | | | | | | | | | lld generates an ELF by adhering to the ELF spec by aligning vma/fileoffset to a page boundary, but this becomes an issue when dealing with large pages. This adds support so that lld generated executables adheres to the ELF spec with the rule vma % p_align = offset % p_align. This is supported by the flag --no-align-segments. This could be the default in few targets like X86_64 to save space on disk. llvm-svn: 221571
* [ELF] Implement demangle.Shankar Easwaran2014-10-201-0/+8
| | | | | | | This adds functionality in the GNU flavor to demangle symbols when undefined symbols are displayed to the user. llvm-svn: 220184
* Sort include files according to convention.Shankar Easwaran2014-10-181-3/+1
| | | | llvm-svn: 220131
* [ELF] Implement --export-dynamic/-ERafael Auler2014-10-081-0/+4
| | | | | | | | | | | | | | | | | When creating a dynamic executable and receiving the -E flag, the linker should export all globally visible symbols in its dynamic symbol table. This commit also moves the logic that exports symbols in the dynamic symbol table from OutputELFWriter to the ExecutableWriter class. It is not correct to leave this at OutputELFWriter because DynamicLibraryWriter, another subclass of OutputELFWriter, already exports all symbols, meaning we can potentially end up with duplicated symbols in the dynamic symbol table when creating shared libs. Reviewers: shankarke http://reviews.llvm.org/D5585 llvm-svn: 219334
* [ELF][Driver] Produce a proper error when file is not foundShankar Easwaran2014-09-081-0/+4
| | | | | | | | | | When a file is not found, produce a proper error message. The previous error message produced a file format error, which made me wonder for a while why there is a file format error, but essentially the file was not found. This fixes the problem by producing a proper error message. llvm-svn: 217359
* [ELF] Implement --rosegmentShankar Easwaran2014-09-081-0/+4
| | | | | | | | | By default linker would not create a separate segment to hold read only data. This option overrides that behavior by creating the a separate read only segment for read only data. llvm-svn: 217358
OpenPOWER on IntegriCloud