summaryrefslogtreecommitdiffstats
path: root/lld
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Remove InputChunk from Symbol baseclassSam Clegg2018-02-202-36/+44
| | | | | | | | | | Instead include InputFuction and InputSegment directly in the subclasses that use them (DefinedFunction and DefinedGlobal). Differential Revision: https://reviews.llvm.org/D43493 llvm-svn: 325603
* [WebAssembly] Check signatures of weakly defined funtions tooSam Clegg2018-02-203-0/+26
| | | | | | | | Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43492 llvm-svn: 325598
* Do not create a temporary data structure for relocations.Rui Ueyama2018-02-205-106/+72
| | | | | | | | | | | | This patch removes `OutRelocations` vector from the InputChunk and directly consume `Relocations` vector instead. This should make the linker faster because we don't create a temporary data structure, and it matches the lld's design principle that we don't create temporary data structures for object files but instead directly consume mmap'ed data whenever possible. Differential Revision: https://reviews.llvm.org/D43491 llvm-svn: 325549
* Merge two small functions and add comments.Rui Ueyama2018-02-191-9/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43406 llvm-svn: 325538
* Removed a variable that is used only once.Rui Ueyama2018-02-191-3/+3
| | | | llvm-svn: 325537
* [WebAssembly] Expand a lambda that is used only once.Rui Ueyama2018-02-191-9/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43435 llvm-svn: 325536
* [WebAssembly] Define toString(wasm::InputChunk *) and use that in MarkLive.cpp.Rui Ueyama2018-02-194-12/+14
| | | | | | | | Define toString(wasm::InputChunk *) and use that in MarkLive.cpp. Differential Revision: https://reviews.llvm.org/D43434 llvm-svn: 325535
* Rename DynamicReloc::getAddend() to computeAddend(). NFCAlexander Richardson2018-02-192-3/+11
| | | | | | | | | | | | | Summary: Before the name of the function sounded like it was just a getter for the private class member Addend. However, it actually calculates the final value for the r_addend field in Elf_Rela that is used when writing the .rela.dyn section. I also added a comment to the UseSymVA member to explain how it interacts with computeAddend(). Differential Revision: https://reviews.llvm.org/D43161 llvm-svn: 325485
* Simplify.Rui Ueyama2018-02-171-5/+4
| | | | llvm-svn: 325453
* Remove an unused accessor and simplify the logic a bit. NFC.Rui Ueyama2018-02-174-13/+15
| | | | llvm-svn: 325445
* Factor out common code from applySecRel functions.Rui Ueyama2018-02-171-24/+29
| | | | | | Differential Revision: https://reviews.llvm.org/D43412 llvm-svn: 325444
* [WebAssembly] Remove unneeded classifer methods from Symbol class. NFC.Sam Clegg2018-02-174-11/+4
| | | | | | | | | We already have isa<> for this, and these methods were simply duplicating those redundantly. Differential Revision: https://reviews.llvm.org/D43422 llvm-svn: 325418
* Use toString to print out garbage-collected sections.Rui Ueyama2018-02-175-12/+11
| | | | | | | | | | Currently, archive file name is missing in this message. In general, we should avoid constructing strings in an ad-hoc manner and instead use toString() to get consistent output strings. Differential Revision: https://reviews.llvm.org/D43420 llvm-svn: 325416
* [WebAssembly] Simplify FunctionSymbol::get/set/hasFunctionType. NFC.Sam Clegg2018-02-166-46/+35
| | | | | | Differential Revision: https://reviews.llvm.org/D43416 llvm-svn: 325415
* [WebAssembly] Remove unneeded Chunk::getFileName() method. NFC.Sam Clegg2018-02-162-2/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D43405 llvm-svn: 325414
* Remove "--full-shutdown" and instead use an environment variable LLD_IN_TEST.Rui Ueyama2018-02-167-18/+22
| | | | | | | | | | | | | | | | | We are running lld tests with "--full-shutdown" option because we don't want to call _exit() in lld if it is running tests. Regular shutdown is needed for leak sanitizer. This patch changes the way how we tell lld that it is running tests. Now "--full-shutdown" is removed, and LLD_IN_TEST environment variable is used instead. This patch enables full shutdown on all ports, e.g. ELF, COFF and wasm. Previously, we enabled it only for ELF. Differential Revision: https://reviews.llvm.org/D43410 llvm-svn: 325413
* Do not print out "no input files" twice.Rui Ueyama2018-02-162-6/+23
| | | | | | Differential Revision: https://reviews.llvm.org/D43408 llvm-svn: 325406
* Use wasm-ld instead of "lld -flavor wasm".Rui Ueyama2018-02-1632-51/+51
| | | | | | | | | | Invoking lld as ld.lld, ld.ld64, lld-link or wasm-ld is preferred than invoking lld as lld and pass an -flavor option. We have "lld" file mostly for historical reasons. Differential Revision: https://reviews.llvm.org/D43407 llvm-svn: 325405
* AMDGPU/LLD: Remove the use of binary file from one of the AMDGPU testsKonstantin Zhuravlyov2018-02-162-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D43413 llvm-svn: 325404
* AMDGPU: Update elf flags in amdgpu-elf-flags.sKonstantin Zhuravlyov2018-02-161-2/+2
| | | | | | | | This is required after r325399: - EF_AMDGPU_ARCH_GCN got removed - In the test, EF_AMDGPU_ARCH_GCN is replaced with EF_AMDGPU_MACH_AMDGCN_GFX803 llvm-svn: 325400
* [COFF] Add support for ARM64 secrel relocations for add/load instructionsMartin Storsjo2018-02-162-5/+57
| | | | | | Differential Revision: https://reviews.llvm.org/D43287 llvm-svn: 325396
* Revert an accidental change to where "-flavor GNU" was used by intention.Rui Ueyama2018-02-161-2/+2
| | | | llvm-svn: 325392
* Replace -flavor {gnu,darwin} with ld64.lld or ld.lld.Rui Ueyama2018-02-16132-209/+209
| | | | llvm-svn: 325390
* Remove `else` after `break`.Rui Ueyama2018-02-161-6/+4
| | | | llvm-svn: 325387
* Use write32le instead of write32<little>.Rui Ueyama2018-02-161-1/+2
| | | | llvm-svn: 325384
* Refactor wasm/WriterUtil.{cpp,h}.Rui Ueyama2018-02-164-40/+33
| | | | | | | | | | | | | | | | Summary: - Makes code more in line with LLVM style (e.g. const char * -> StringRef) - Do not use formatv since we can construct message just by `+` - Replace some odd types such as `const StringRef` with more common type - Do not use default arguments if they are not necessary Reviewers: sbc100 Subscribers: jfb, aheejin, llvm-commits, sunfish Differential Revision: https://reviews.llvm.org/D43403 llvm-svn: 325383
* [WebAssebmly] Remove unneeded cast. NFC.Sam Clegg2018-02-161-1/+1
| | | | llvm-svn: 325382
* ELF: Stop collecting a list of symbols in ArchiveFile.Peter Collingbourne2018-02-167-30/+27
| | | | | | | | | | | | There seems to be no reason to collect this list of symbols. Also fix a bug where --exclude-libs would apply to all symbols that appear in an archive's symbol table, even if the relevant archive member was not added to the link. Differential Revision: https://reviews.llvm.org/D43369 llvm-svn: 325380
* Don't depend on "call foo" producing a X86_64_PC32.Rafael Espindola2018-02-1611-32/+54
| | | | | | | | | | Newer versions of the gnu assembler produce a X86_64_PLT32 for calls. There is a change under review in llvm to do the same, so update the tests to not depend on it. We can still produce a R_X86_64_PC32 with ".long foo - .". llvm-svn: 325379
* Style fix. NFC.Rui Ueyama2018-02-162-33/+33
| | | | llvm-svn: 325377
* [WebAssembly] Fix bug is function signature checkingSam Clegg2018-02-163-37/+39
| | | | | | | | | | This bug effected undefined symbols that were resolved by existing defined symbols. We were skipping the signature check in this case. Differential Revision: https://reviews.llvm.org/D43399 llvm-svn: 325376
* [WebAssembly] Fix typos in comment. NFC.Sam Clegg2018-02-161-3/+3
| | | | | | Patch by Nicholas Wilson! llvm-svn: 325370
* Simplify RelocationBaseSection::addReloc.Rafael Espindola2018-02-163-16/+12
| | | | | | | | Now that we have R_ADDEND, UseSymVA was redundant. We only want to write the symbol virtual address when using an expression other than R_ADDEND. llvm-svn: 325360
* [ELF] Extend symbol-order-warnings test case for ICFJames Henderson2018-02-161-1/+19
| | | | | | | | | | | | Reviewed by: rafael Differential Revision: https://reviews.llvm.org/D43336 There is some discussion as to the exact behaviour of combining ICF and --symbol-ordering-file, but it seems beneficial to warn when attempting to order the removed symbol regardless of the preferred approach. llvm-svn: 325333
* [ELF] - Fix comment. NFC.George Rimar2018-02-161-1/+1
| | | | | | Addresses forgotten comment for D43071. llvm-svn: 325332
* [ELF] - Support COPY, INFO, OVERLAY output sections attributes.George Rimar2018-02-164-4/+47
| | | | | | | | | | | | | | This is PR36298. (COPY), (INFO), (OVERLAY) all have the same effect: section should be marked as non-allocatable. (https://www.eecs.umich.edu/courses/eecs373/readings/Linker.pdf, 3.6.8.1 Output Section Type) Differential revision: https://reviews.llvm.org/D43071 llvm-svn: 325331
* Ensure that Elf_Rel addends are always written for dynamic relocationsAlexander Richardson2018-02-167-7/+62
| | | | | | | | | | | | Summary: This follows up on r321889 where writing of Elf_Rel addends was partially moved to RelocationBaseSection. This patch ensures that the addends are always written to the output section when a input section uses RELA but the output is REL. Differential Revision: https://reviews.llvm.org/D42843 llvm-svn: 325328
* Fix an issue that weak bit is dropped when there's a lazy object symbol.Rui Ueyama2018-02-162-2/+24
| | | | | | | | Previously, we accidentally dropped STB_WEAK bit from an undefined symbol if there is a lazy object symbol with the same name. That caused a compatibility issue with GNU gold. llvm-svn: 325316
* [ELF] Fix use after free in case of using --whole-archive.Igor Kudrin2018-02-164-3/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D34554 llvm-svn: 325313
* Relax relocation type checking in a non-ALLOC section.Rui Ueyama2018-02-163-14/+40
| | | | | | | | | | | | | | | | | | Even though it doesn't make sense, there seems to be multiple programs in the wild that create PC-relative relocations in non-ALLOC sections. I believe this is caused by the negligence of GNU linkers to not report any errors for such relocations. Currently, lld emits warnings against such relocations and exits. So, you cannot link any program that contains wrong relocations until you fix an issue in a program that generates wrong ELF files. It's often impractical to fix a program because it's not always easy. This patch relaxes the error checking and emit a warning instead. Differential Revision: https://reviews.llvm.org/D43351 llvm-svn: 325307
* [ELF] Simplify handling of AT section attribute.Igor Kudrin2018-02-153-9/+40
| | | | | | | | This also makes the behavior close to GNU ld's. Differential Revision: https://reviews.llvm.org/D43284 llvm-svn: 325213
* Fix an issue that lld drops symbol versions for -r.Rui Ueyama2018-02-152-1/+15
| | | | | | | | | | When we are emitting a relocatable output, we should keep the original symbol name including "@" part. Previously, we drop that part unconditionally which resulted in dropping versions from symbols. Differential Revision: https://reviews.llvm.org/D43307 llvm-svn: 325204
* [WebAssebmly] Remove use of Optional to fix assertion in gccSam Clegg2018-02-142-8/+14
| | | | | | | | | | | | | | This was causing GCC builds with fail with: Symbols.h:240:3: error: static assertion failed: Symbol types must be trivially destructible static_assert(std::is_trivially_destructible<T>( The reason this is a gcc-only failure is that OptionalStorage has as specialization for POD types that isn't built under GCC. Differential Revision: https://reviews.llvm.org/D43317 llvm-svn: 325185
* Revert r325158: Convert an assert to a static_assert. NFC.Rui Ueyama2018-02-143-6/+6
| | | | | | This reverts commit r325158 because it broke GCC builds. llvm-svn: 325183
* Remove a failing static_assert.Rui Ueyama2018-02-141-2/+0
| | | | | | | This static_assert is legitimate, but it is failing on some build environments. I'm removing it until it's fixed to unbreak the bots. llvm-svn: 325181
* Convert an assert to a static_assert. NFC.Sam Clegg2018-02-143-6/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D43305 llvm-svn: 325158
* Make --export-dynamic-symbol to add undefined symbols even if ↵Rui Ueyama2018-02-142-4/+12
| | | | | | | | | | | | --export-dynamic is given. This patch addresses a minor compatibility issue with GNU linkers. Previously, --export-dynamic-symbol is completely ignored if you pass --export-dynamic together. Differential Revision: https://reviews.llvm.org/D43266 llvm-svn: 325152
* [WebAssembly] Use a Symbol class heirarchy. NFC.Sam Clegg2018-02-147-194/+295
| | | | | | | | | This brings wasm into line with ELF and COFF in terms of symbol types are represented. Differential Revision: https://reviews.llvm.org/D43112 llvm-svn: 325150
* [ELF] Add warnings for various symbols that cannot be orderedJames Henderson2018-02-147-8/+224
| | | | | | | | | | | | | | | | | | | | | | | | | There are a number of different situations when symbols are requested to be ordered in the --symbol-ordering-file that cannot be ordered for some reason. To assist with identifying these symbols, and either tidying up the order file, or the inputs, a number of warnings have been added. As some users may find these warnings unhelpful, due to how they use the symbol ordering file, a switch has also been added to disable these warnings. The cases where we now warn are: * Entries in the order file that don't correspond to any symbol in the input * Undefined symbols * Absolute symbols * Symbols imported from shared objects * Symbols that are discarded, due to e.g. --gc-sections or /DISCARD/ linker script sections * Multiple of the same entry in the order file Reviewed by: rafael, ruiu Differential Revision: https://reviews.llvm.org/D42475 llvm-svn: 325125
* Add make targets for running all lld testsNicholas Wilson2018-02-141-0/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D42587 llvm-svn: 325124
OpenPOWER on IntegriCloud