summaryrefslogtreecommitdiffstats
path: root/lld/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-226-12/+12
| | | | | | | | | | definition below all of the header #include lines, LLD edition. IF you want to know more details about this, you can see the recent commits to Debug.h in LLVM. This is just the LLD segment of a cleanup I'm doing globally for this macro. llvm-svn: 206851
* [PECOFF] Handle line comment in module-definition file.Rui Ueyama2014-04-221-41/+48
| | | | | | In .def files, ';' is the start of line comment. llvm-svn: 206831
* [PECOFF] Win64 DLL entry function name is _DllMainCRTStartup.Rui Ueyama2014-04-181-4/+7
| | | | | | Unlike Win32/x86, it has no "@12" suffix. llvm-svn: 206648
* [PECOFF] Support LIBRARY directive.Rui Ueyama2014-04-182-0/+14
| | | | | | | LIBRARY directive in a module definition file specifies the output DLL file name. It also takes an optional value for the base address. llvm-svn: 206647
* Use switch for readability.Rui Ueyama2014-04-181-12/+15
| | | | llvm-svn: 206638
* [PECOFF] Ignore /ignore option.Rui Ueyama2014-04-181-0/+1
| | | | | | | | /ignore:<number> is a linker option to disable warning specified by the number. We ignore the option because it does not make sense for LLD. llvm-svn: 206636
* [PECOFF] Support /manifestuac:NO.Rui Ueyama2014-04-181-20/+26
| | | | | | | If the value for /manifestuac is "NO", LLD will create a manifest XM file but won't emit <trustinfo> element. llvm-svn: 206633
* [ELF] Fix GNU_RELRO section name.Rui Ueyama2014-04-181-1/+1
| | | | llvm-svn: 206560
* [ELF] Support --defsym=<symbol>=<symbol>.Rui Ueyama2014-04-162-7/+95
| | | | | | | | | | | | | | | | | | | | | Currently LLD supports --defsym only in the form of --defsym=<symbol>=<integer>, where the integer is interpreted as the absolute address of the symbol. This patch extends it to allow other symbol name to be given as an RHS value. If a RHS value is a symbol name, the LHS symbol will be defined as an alias for the RHS symbol. Internally, a LHS symbol is represented as a zero-size defined atom who has an LayoutAfter reference to an undefined atom, whose name is the RHS value. Everything else is already implemented -- Resolver will resolve the undefined symbol, and the layout pass will layout the two atoms at the same location. Looks like it's working fine. Note that GNU LD supports --defsym=<symbol>=<symbol>+<addend>. That feature is out of scope of this patch. Differential Revision: http://reviews.llvm.org/D3332 llvm-svn: 206417
* [Mips] Emit PLT entries for more static relocations.Simon Atanasyan2014-04-161-6/+18
| | | | llvm-svn: 206358
* Add missing includes.Benjamin Kramer2014-04-122-0/+2
| | | | llvm-svn: 206113
* [ELF] Regroup code creates ELF relocations references ELFReference intoSimon Atanasyan2014-04-123-118/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a couple of new virtual functions. Follow-up to the rL203408. Two virtual functions `createRelocationReference()` responsible for creation of `ELFReference` have been replaced by a couple of new virtual functions `createRelocationReferences()` (plural). Each former function creates a //single// ELFReference for a specified `Elf_Rela` or `Elf_Rel` relocation records. The new functions responsible for creation of //all// relocation references for provided symbol. For all targets except MIPS there are no functional changes. MIPS ABI has a notion of //paired// relocations. An effective addend of such relocations are calculated using addends of both pair's members. Each `R_MIPS_HI16` and `R_MIPS_GOT16` (for local symbols) relocations must have an associated `R_MIPS_LO16` entry immediately following it in the list of relocations. Immediately does not mean "next record" in relocations section but "next record referenced the same symbol". Moreover a single `R_MIPS_LO16` relocation can be paired with multiple preceding `R_MIPS_HI16/R_MIPS_GOT16` relocations. The paired relocation can have offsets belong to the different symbols. That is why we need to have access to list of all relocations during construction of `ELFReference` for MIPS target. The patch reviewed by Shankar Easwaran. llvm-svn: 206102
* [Mips] Factor out MIPS relocation addend reading to the separateSimon Atanasyan2014-04-111-8/+12
| | | | | | | | function. No functional changes. llvm-svn: 206023
* [ELF] Remove redundant conversion of section content from ArrayRef toSimon Atanasyan2014-04-111-8/+3
| | | | | | | | | StringRef before calling the createSectionAtom() method and reverse conversion inside the method. No functional changes. llvm-svn: 206022
* [Mips] R_MIPS_PC32 relocation support.Simon Atanasyan2014-04-114-0/+12
| | | | llvm-svn: 206018
* Update to match changes made in r205955David Majnemer2014-04-102-0/+7
| | | | llvm-svn: 205956
* [PECOFF] Fix common symbol alignment.Rui Ueyama2014-04-091-0/+8
| | | | | | Differential Revision: http://reviews.llvm.org/D3322 llvm-svn: 205826
* Early continue to reduce nesting.Rui Ueyama2014-04-071-13/+13
| | | | llvm-svn: 205737
* No else after return.Rui Ueyama2014-04-071-4/+3
| | | | llvm-svn: 205736
* [ELF] Accept "-rpath=<foo>" as well as "-rpath <foo>".Rui Ueyama2014-04-061-2/+2
| | | | llvm-svn: 205694
* [ELF] Fix driver bug.Rui Ueyama2014-04-061-3/+3
| | | | | | | | GNU LD-comptaible driver wrongly requires a space after '=' for a few options such as "-init=<symbol>" or "-entry=<symbol>". This patch is to fix that bug and add a few tests for it. llvm-svn: 205693
* [ELF] Use typedefs to make class field declarations shorter.Simon Atanasyan2014-04-061-7/+4
| | | | | | No functional changes. llvm-svn: 205692
* [ELF] Fix --soname option.Rui Ueyama2014-04-051-1/+3
| | | | | | | | | | | | | | | Currently LLD accepts only "-soname <string>", but all the following options are actually valid. --soname=foo --soname foo -soname=foo -soname foo -h foo This patch fixes that issue. llvm-svn: 205662
* [ELF] Diagnose malformed --dynsym option.Rui Ueyama2014-04-041-1/+1
| | | | llvm-svn: 205654
* [X86-64] Add missing relocation.Michael J. Spencer2014-04-041-1/+1
| | | | llvm-svn: 205645
* This is yet another case clang-modernize failed to add "override".Rui Ueyama2014-04-041-6/+3
| | | | llvm-svn: 205644
* Split a utility function not to use goto statement.Rui Ueyama2014-04-041-14/+17
| | | | llvm-svn: 205643
* useNew is set to false in all branches, so set it to false outside the if-else.Rui Ueyama2014-04-041-21/+15
| | | | llvm-svn: 205642
* Replace dyn_cast<T>s immediately followed by asserts with cast<T>s.Rui Ueyama2014-04-041-9/+4
| | | | llvm-svn: 205641
* Fix indentation.Rui Ueyama2014-04-041-34/+28
| | | | llvm-svn: 205639
* Revert "temporary commit."Rui Ueyama2014-04-041-28/+34
| | | | | | This reverts commit r205635 that was submitted by mistake. llvm-svn: 205637
* temporary commit.Rui Ueyama2014-04-041-34/+28
| | | | llvm-svn: 205635
* SymbolTable::size() returns an unsigned int.Rui Ueyama2014-04-041-1/+1
| | | | | | | It's better to use the same type rather than a fixed width integer type that may be different from the return type. llvm-svn: 205597
* Use range-based for loop. No functionality change.Rui Ueyama2014-04-041-16/+9
| | | | llvm-svn: 205594
* Do not use temporary variables to pass them to forEachUndefines.Rui Ueyama2014-04-041-14/+13
| | | | | | So that it's obvious that we pass these callbacks only to forEachUndefines. llvm-svn: 205593
* Return a vector rather than mutating a given one.Rui Ueyama2014-04-042-12/+13
| | | | | | | | This is cleaner and as efficient as before. Differential Revision: http://llvm-reviews.chandlerc.com/D3284 llvm-svn: 205590
* Rename getInputGraph() and getNextFile().Rui Ueyama2014-04-045-16/+16
| | | | | | | | | Seems getSomething() is more common naming scheme than just a noun to get something, so renaming these members. Differential Revision: http://llvm-reviews.chandlerc.com/D3285 llvm-svn: 205589
* Update comment.Rui Ueyama2014-04-031-1/+2
| | | | llvm-svn: 205579
* Minor cleanups.Rui Ueyama2014-04-032-11/+5
| | | | llvm-svn: 205578
* Replace a recursion with a loop for speed.Rui Ueyama2014-04-031-5/+7
| | | | llvm-svn: 205576
* Do not check deadStripNever twice.Rui Ueyama2014-04-031-28/+8
| | | | | | | | | | Atoms with deadStripNever attribute has already been added to the dead strip root set at end of Resolver::doDefinedAtom, so no need to check it for each atom again. Differential Revision: http://llvm-reviews.chandlerc.com/D3282 llvm-svn: 205575
* Move code into a helper function.Rui Ueyama2014-04-031-19/+15
| | | | | | | Move code that always runs after doUndefinedAtom into doUndefinedAtom for readability. llvm-svn: 205574
* Minor cleanup.Rui Ueyama2014-04-031-9/+5
| | | | llvm-svn: 205570
* Simplify two if's.Rui Ueyama2014-04-031-5/+3
| | | | llvm-svn: 205569
* Fix comments.Rui Ueyama2014-04-036-7/+7
| | | | llvm-svn: 205568
* Early return.Rui Ueyama2014-04-031-7/+9
| | | | llvm-svn: 205567
* Fix ELFFileNode::resetNextIndex().Rui Ueyama2014-04-031-25/+16
| | | | | | | | | | | | | | | | | | | ELFLinkingContext has a method addUndefinedAtomsFromSharedLibrary(). The method is being used to skip a shared library within --start-group and --end-group if it's not the first iteration of the group. We have the same, incomplete mechanism to skip a shared library within a group too. That's implemented in ELFFileNode. It's intended to not return a shared library on the second or further iterations in the first place. This mechanism is preferred over addUndefinedAtomsFromSharedLibrary because the policy is implemented in Input Graph -- that's what Input Graph is for. This patch removes the dupluicate feature and fixes ELFFileNode. Differential Revision: http://llvm-reviews.chandlerc.com/D3280 llvm-svn: 205566
* Expand 'auto' that's hard for human to deduce its real type.Rui Ueyama2014-04-035-6/+6
| | | | llvm-svn: 205564
* Add empty() to atom_collection.Rui Ueyama2014-04-032-4/+4
| | | | | | | | | "x.empty()" is more idiomatic than "x.size() == 0". This patch is to add such method and use it in LLD. Differential Revision: http://llvm-reviews.chandlerc.com/D3279 llvm-svn: 205558
* Remove "this->".Rui Ueyama2014-04-031-10/+10
| | | | | | | For most member function calls we do not use "this->" in this file. Remove the rest for consistency. llvm-svn: 205550
OpenPOWER on IntegriCloud