summaryrefslogtreecommitdiffstats
path: root/lld
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] Fix a test comment. NFCFangrui Song2018-03-011-1/+1
| | | | llvm-svn: 326400
* [WebAssembly] Use Twine rather than StringRef for logging messagesSam Clegg2018-03-012-15/+19
| | | | | | | | Also add missing tracing to writeU8. Differential Revision: https://reviews.llvm.org/D43919 llvm-svn: 326398
* Use DenseMap::lookup() instead of find() and a hand-written null check.Rui Ueyama2018-02-282-8/+2
| | | | llvm-svn: 326382
* [WebAssembly] Reduce code repetition. NFC.Rui Ueyama2018-02-283-21/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D43910 llvm-svn: 326379
* Make sure that clang-format doesn't reorder include files.Rui Ueyama2018-02-281-0/+2
| | | | | | | clang-format won't reorder include files if there is a blank line. Thanks to Nico for the tips. llvm-svn: 326371
* Write some tests as linker scripts instead of assembly files.Rui Ueyama2018-02-286-83/+79
| | | | | | | | | | Some linker script test cases contain only a few lines of assembly and a long linker script. Such tests are easier to maintain if we write the main test file as a linkier script instead of assembly. Differential Revision: https://reviews.llvm.org/D43887 llvm-svn: 326363
* Attempt to build breakage caused by r326339.Rui Ueyama2018-02-281-1/+1
| | | | | | | clang-format automatically sorted the #include lines, but I believe Windows.h needs to be included before Dbghelp.h. llvm-svn: 326360
* [WebAssembly] Remove unneeded --no-gc-sections flag from tests. NFC.Sam Clegg2018-02-282-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D43889 llvm-svn: 326356
* Add "%" operator to the linker script.Rui Ueyama2018-02-282-1/+12
| | | | | | | | This patch improves compatibility with GNU linkers. Differential Revision: https://reviews.llvm.org/D43883 llvm-svn: 326348
* Inline a trivial function. NFC.Rui Ueyama2018-02-281-5/+1
| | | | llvm-svn: 326347
* Fix use after free in PDB linker.Zachary Turner2018-02-281-2/+13
| | | | | | | | | | | | | | | | | | When merging in types from a type server PDB, we would use a pointer into the type server PDB's mapped file buffer directly to avoid copying data. However, we would close the type server PDB after we finished merging in its types, which would unmap all of its memory. This would lead to a use after free. We fix this by making a strong reference in the PDBLinker class to all referenced type server PDBs, thereby making it safe to hold pointers into its memory mapped contents. This fixes llvm.org/pr36455 Differential Revision: https://reviews.llvm.org/D43834 llvm-svn: 326345
* Simplify. NFC.Rafael Espindola2018-02-281-3/+3
| | | | llvm-svn: 326344
* [WebAssembly] Use toArrayRef. NFC.Rui Ueyama2018-02-281-6/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D43855 llvm-svn: 326340
* Merge {COFF,ELF}/Strings.cpp to Common/Strings.cpp.Rui Ueyama2018-02-2822-210/+134
| | | | | | | | | This should resolve the issue that lld build fails in some hosts that uses case-insensitive file system. Differential Revision: https://reviews.llvm.org/D43788 llvm-svn: 326339
* [WebAssembly] Return a StringRef instead of std::string from ↵Rui Ueyama2018-02-282-8/+8
| | | | | | | | getSectionName(). NFC. Differential Revision: https://reviews.llvm.org/D43854 llvm-svn: 326337
* [WebAssembly] Improve WasmSignatureDenseMapInfo.Rui Ueyama2018-02-281-4/+3
| | | | | | | | | | | | | | Let X and Y be types. Previously, functions F(X, Y) and G(Y, X) had the same hash value because their hash values are computed as follows: hash(F) = hash(X) + hash(Y) hash(G) = hash(Y) + hash(X) This patch fixes the issue by using hash_combine. Differential Revision: https://reviews.llvm.org/D43856 llvm-svn: 326336
* [WebAssembly] Reorder symbol table to match MC orderNicholas Wilson2018-02-285-90/+90
| | | | | | | | | Update LLD test expectations for new symbol ordering introduced by Differential D43685. Differential Revision: https://reviews.llvm.org/D43875 llvm-svn: 326335
* [ELF] Process linker scripts deeper when declaring symbols.Igor Kudrin2018-02-283-15/+39
| | | | | | | | We should process symbols inside output section declarations the same way as top-level ones. Differential Revision: https://reviews.llvm.org/D43008 llvm-svn: 326305
* [WebAssembly] Fix variable name.Rui Ueyama2018-02-281-1/+1
| | | | llvm-svn: 326301
* [WebAssembly] Remove unnecessary namespace specifiers. NFC.Rui Ueyama2018-02-281-2/+2
| | | | llvm-svn: 326300
* [WebAssembly] Simplify initializeSymbols and merge it with ObjFile::parse. NFC.Rui Ueyama2018-02-282-70/+43
| | | | | | | | | | | This patch simplifies initializeSymbols. Since that function is called at the tail context of ObjFile::parse, and the function is called only once from that function, that's effectively just a continuation of ObjFile::parse. So this patch merge it with ObjFile::parse. Differential Revision: https://reviews.llvm.org/D43848 llvm-svn: 326296
* [WebAssembly] Add test for `--undefined` flag. NFC.Sam Clegg2018-02-281-2/+3
| | | | | | | | | Specifically the case where the undefined symbol is not found during the link. Differential Revision: https://reviews.llvm.org/D43846 llvm-svn: 326294
* [WebAssembly] Simplify Symbol::getWasmType. NFC.Rui Ueyama2018-02-281-10/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D43717 llvm-svn: 326293
* [WebAssembly] Inline translateVA as it's trivial.Rui Ueyama2018-02-283-11/+3
| | | | | | | | | | | The problem I want to address now is that chunks have too many data members for "offsets", and their origins are not well defined. For example, InputSegment has OutputSegmentOffset, but it's base class also has OutputOffset. That's very confusing. Differential Revision: https://reviews.llvm.org/D43726 llvm-svn: 326291
* [WebAssembly] Remove ELF-ness.Rui Ueyama2018-02-281-10/+6
| | | | | | | | | These output section names are ELF-specific. We shouldn't have this rule for WebAssembly. Differential Revision: https://reviews.llvm.org/D43712 llvm-svn: 326289
* [ELF] Rename test/ELF/note-loadaddr.c to .s NFCFangrui Song2018-02-281-0/+0
| | | | llvm-svn: 326287
* [WebAssembly] Do not use inheritance to define SubSection.Rui Ueyama2018-02-283-60/+58
| | | | | | | | | | | | | | SubSection inherited from SyntheticSection, and SyntheticSection inherits from OutputSection, so SubSection was an OutputSection. But that's wrong because SubSection is not actually a WebAssembly output section. It shares some functionalities with OutputSection, but overall it's very different. This patch removes that inheritance. Differential Revision: https://reviews.llvm.org/D43719 llvm-svn: 326286
* [WebAssembly] Refactor ObjFile::initializeSymbols.Rui Ueyama2018-02-282-66/+47
| | | | | | | | The main purpose of this change is to make initializeSymbols shorter. Differential Revision: https://reviews.llvm.org/D43691 llvm-svn: 326285
* [WebAssembly] Do not use Subsection as a local variable name.Rui Ueyama2018-02-281-40/+39
| | | | | | | | That variable hides the class of the same name. Differential Revision: https://reviews.llvm.org/D43718 llvm-svn: 326283
* [WebAssembly] Do not use default arguments for SymbolTable.Rui Ueyama2018-02-282-7/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D43727 llvm-svn: 326282
* [WebAssembly] Do not remove existing output file.Rui Ueyama2018-02-281-1/+0
| | | | | | | | | | | | | | | | FileOutputBuffer automatically removes an existing file, so we don't need to do that. Actually doing that is discouraged because when the linker fails to create an output for some reason after instantiating FileOutputBufffer, FileOutputBuffer removes a temporary file and don't touch an existing file. That's an desired behavior from the user's point of view. (Internally, FileOutputBuffer writes its contents to a temporary file and then rename it over to an existing file on commit()). Differential Revision: https://reviews.llvm.org/D43728 llvm-svn: 326281
* [WebAssembly] Remove redundant local variables.Rui Ueyama2018-02-281-10/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D43709 llvm-svn: 326280
* [WebAssembly] Simplify createLikingSection.Rui Ueyama2018-02-281-7/+17
| | | | | | | | | | | | Summary: [WebAssembly] Simplify createLikingSection. Reviewers: sbc100 Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43715 llvm-svn: 326279
* [WebAssembly] Inline accessor functions that are called only once.Rui Ueyama2018-02-282-63/+19
| | | | | | | | | | | | Looks like these accessor functions are a bit overly defensive, and due to the amount of code, that part isn't easy to read. We have code to log translation results in writeTo and writeRelocations, so I don't think we need to log it again in these functions. I think the new function is much easier to understand. Differential Revision: https://reviews.llvm.org/D43713 llvm-svn: 326277
* [WebAssembly] Remove trivial accessors.Rui Ueyama2018-02-283-15/+9
| | | | | | | | {set,get}OutputSegment don't hide anything, so remove them. Differential Revision: https://reviews.llvm.org/D43724 llvm-svn: 326276
* [WebAssembly] Use more specific type and simplify code.Rui Ueyama2018-02-281-20/+13
| | | | | | | | | Instead of {Function,Global,Data}Symbol, use Defined{Function,Global,Data} because undefined symbol should never reach this function. Differential Revision: https://reviews.llvm.org/D43710 llvm-svn: 326275
* [WebAssembly] Remove LastDefinedKind for consistency with undefined kinds. NFC.Rui Ueyama2018-02-281-6/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43711 llvm-svn: 326274
* [WebAssembly] Remove premature optimization.Rui Ueyama2018-02-281-1/+1
| | | | | | | | | | I think calling reserve() for each object file is too many and isn't useful. We can add reserve() later. By default, we shouldn't add reserve() to a lot of places. Differential Revision: https://reviews.llvm.org/D43722 llvm-svn: 326273
* [WebAssembly] Separate addUndefined into addUndefined{Function,Data,Global}.Rui Ueyama2018-02-284-128/+150
| | | | | | | | | | | | | | | Previously, one function adds all types of undefined symbols. That doesn't fit to the wasm's undefined symbol semantics well because different types of undefined symbols are very different in wasm. As a result, separate control flows merge in this addUndefined function and then separate again for each type. That wasn't easy to read. This patch separates the function into three functions. Now it is pretty clear what we are doing for each undefined symbol type. Differential Revision: https://reviews.llvm.org/D43697 llvm-svn: 326271
* [WebAssembly] Use StringRef instead of `const char *`.Rui Ueyama2018-02-281-10/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D43721 llvm-svn: 326269
* [WebAssembly] Remove DataSize from linking metadataSam Clegg2018-02-2716-59/+9
| | | | | | | | | This means we don't need to write the linking metadata section at all for executable (non-relocatable) output. Differential Revision: https://reviews.llvm.org/D42869 llvm-svn: 326268
* [ELF] Add llvm-readelf to the lit tool substitutionsAlexander Richardson2018-02-271-2/+2
| | | | | | | | | | | | | | | | | Summary: Some of the tests invoke llvm-readelf. This currently appears to work probably because the LLVM binary directory is included in $PATH. However, this is quite fragile so let's just make lit expand the full path. Reviewers: ruiu, espindola Reviewed By: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43827 llvm-svn: 326257
* Add `--dynamic-linker=foo` as an alias for `--dynamic-linker foo`.Rui Ueyama2018-02-273-12/+25
| | | | | | This patch fixes a minor compatibility issue with ld.gold and ld.bfd. llvm-svn: 326243
* Put undefined symbols from shared libraries in the symbol table.Rafael Espindola2018-02-277-47/+5
| | | | | | | With the recent fixes these symbols have more in common than not with regular undefined symbols. llvm-svn: 326242
* Add missing REQUIRES.Rafael Espindola2018-02-271-0/+2
| | | | llvm-svn: 326210
* Fix gcc warning.Rafael Espindola2018-02-271-1/+2
| | | | | | Should fix the build in some bots. llvm-svn: 326209
* Add support for SHF_ARM_PURECODE.Rafael Espindola2018-02-272-3/+49
| | | | | | | Now we don't mark a PT_LOAD as readable if all its sections are SHF_ARM_PURECODE. llvm-svn: 326207
* [ELF] - Format, fix mistype. NFC.George Rimar2018-02-271-3/+2
| | | | llvm-svn: 326198
* [ELF] - Fix case of using both --icf and --symbol-ordering-file together.George Rimar2018-02-272-1/+33
| | | | | | | | | | | | | Imagine that we have sections A, B, C, where A == C and symbol ordering file containing symbols: symC, symB, symA Previously because of ICF it was possible that final order would be B, A or B, C. That violates order specified in ordering file. Patch changes that. Differential revision: https://reviews.llvm.org/D43234 llvm-svn: 326179
* [ELF] Create and export symbols provided by a linker script if they ↵Igor Kudrin2018-02-277-12/+38
| | | | | | | | | | | referenced by DSOs. It should be possible to resolve undefined symbols in dynamic libraries using symbols defined in a linker script. Differential Revision: https://reviews.llvm.org/D43011 llvm-svn: 326176
OpenPOWER on IntegriCloud