summaryrefslogtreecommitdiffstats
path: root/lld
Commit message (Collapse)AuthorAgeFilesLines
...
* [MinGW] Ignore the --start-group --end-group parametersMartin Storsjo2018-02-271-0/+2
| | | | | | | | | | These are required for handling circular dependencies between static libraries, which is something that lld-link always does without any extra parameters. Differential Revision: https://reviews.llvm.org/D43786 llvm-svn: 326172
* Keep flags from phantom synthetic sections.Rafael Espindola2018-02-266-30/+69
| | | | | | | | | | | | | | | | | | | | | This fixes pr36475. I think this code can be simplified a bit, but I would like to check in the more direct fix if we are in agreement on the direction and then refactor. This is not something that bfd does. The issue is not noticed in bfd because it keeps fewer sections from the linkerscript in the output. The reasons why it seems reasonable to do this: - As George noticed, we would still keep the flags if the output section had both an empty synthetic section and a regular section - We need an heuristic to find the flags of output sections. Using the flags of a synthetic section that would have been there seems a reasonable heuristic. llvm-svn: 326137
* Re-land: "[Support] Replace HashString with djbHash."Jonas Devlieghere2018-02-261-2/+2
| | | | | | | | | | | | | | | | | | | | | This patch removes the HashString function from StringExtraces and replaces its uses with calls to djbHash from DJB.h. This change is *almost* NFC. While the algorithm is identical, the djbHash implementation in StringExtras used 0 as its default seed while the implementation in DJB uses 5381. The latter has been shown to result in less collisions and improved avalanching and is used by the DWARF accelerator tables. Because some test were implicitly relying on the hash order, I've reverted to using zero as a seed for the following two files: lld/include/lld/Core/SymbolTable.h llvm/lib/Support/StringMap.cpp Differential revision: https://reviews.llvm.org/D43615 llvm-svn: 326091
* [ELF] - Fix variable name and mistype in comment. NFC.George Rimar2018-02-261-4/+4
| | | | llvm-svn: 326090
* Revert "[Support] Replace HashString with djbHash."Jonas Devlieghere2018-02-261-2/+2
| | | | | | | | | | | | | It looks like some of our tests depend on the ordering of hashed values. I'm reverting my changes while I try to reproduce and fix this locally. Failing builds: lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/18388 lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/6743 lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/15607 llvm-svn: 326082
* [Support] Replace HashString with djbHash.Jonas Devlieghere2018-02-261-2/+2
| | | | | | | | | | | | | | | This removes the HashString function from StringExtraces and replaces its uses with calls to djbHash from DJB.h This is *almost* NFC. While the algorithm is identical, the djbHash implementation in StringExtras used 0 as its seed while the implementation in DJB uses 5381. The latter has been shown to result in less collisions and improved avalanching. https://reviews.llvm.org/D43615 (cherry picked from commit 77f7f965bc9499a9ae768a296ca5a1f7347d1d2c) llvm-svn: 326081
* [WebAssembly] Remove dead code.Rui Ueyama2018-02-241-1/+0
| | | | llvm-svn: 326018
* [WebAssembly] Remove dead code.Rui Ueyama2018-02-241-4/+0
| | | | llvm-svn: 326017
* [WebAssebmly] Minor simplification. NFC.Rui Ueyama2018-02-241-5/+6
| | | | llvm-svn: 326013
* Do not use `auto` for type that is not obvious in a local context.Rui Ueyama2018-02-241-2/+2
| | | | llvm-svn: 326012
* [ELF] Fix IsPreemptible comment and typo. NFCFangrui Song2018-02-233-4/+4
| | | | llvm-svn: 325963
* Remove dead code.Rui Ueyama2018-02-231-2/+0
| | | | llvm-svn: 325955
* Inline printHelp.Rui Ueyama2018-02-231-5/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D43526 llvm-svn: 325953
* Handle --version before handling --mllvm.Rui Ueyama2018-02-231-5/+6
| | | | | | | | Because it's a waste of time to handle --mllvm before --version. Differential Revision: https://reviews.llvm.org/D43527 llvm-svn: 325952
* Inline a trivial ctor.Rui Ueyama2018-02-231-15/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D43525 llvm-svn: 325948
* [ELF][MIPS] Set EI_ABIVERSION flag accordingly to MIPS ABIs requirementSimon Atanasyan2018-02-234-3/+37
| | | | | | | | MIPS ABIs require that if an executable file uses non-PIC model, the EI_ABIVERSION entry in the ELF header should be incremented from 0 to 1. That allows obsoleted / limited dynamic linkers refuse to link them. llvm-svn: 325890
* [ELF] - Do not remove empty output sections that are explicitly assigned to ↵George Rimar2018-02-235-37/+25
| | | | | | | | | | | | | phdr in script. This continues direction started in D43069. We can keep sections that are explicitly assigned to segment in script. It helps to simplify code. Differential revision: https://reviews.llvm.org/D43571 llvm-svn: 325887
* Recommit "[ELF] - Do not crash with --emit-relocs and --icf=all together."George Rimar2018-02-232-9/+39
| | | | | | | | | | | | | | | | Latest patch version now. Original commit message: [ELF] - Do not crash with --emit-relocs and --icf=all together. Previously we would crash because did not mark .rel[a] sections as dead and they tried to access parent which was not live after ICF and therefore was null. Differential revision: https://reviews.llvm.org/D43241 llvm-svn: 325879
* [ELF] - Revert r325877 "[ELF] - Do not crash with --emit-relocs and ↵George Rimar2018-02-232-35/+0
| | | | | | | | --icf=all together." Not latest version of patch was committed by mistake. llvm-svn: 325878
* [ELF] - Do not crash with --emit-relocs and --icf=all together.George Rimar2018-02-232-0/+35
| | | | | | | | | | Previously we would crash because did not mark .rel[a] sections as dead and they tried to access parent which was not live after ICF and therefore was null. Differential revision: https://reviews.llvm.org/D43241 llvm-svn: 325877
* [ELF] - Report error if removed empty output section declaration used ↵George Rimar2018-02-232-0/+22
| | | | | | | | | | | | | | undefined symbols. This is for fixing PR36297. Issue itself is that if we have SECTIONS { .bar (a+b) : { *(.stub) } }; script and no section .stub, when LLD will remove .bar, but produce output with undefined symbols a and b. Differential revision: https://reviews.llvm.org/D43069 llvm-svn: 325875
* [ELF] - Added testcase for testing visibility of weak_odr symbols.George Rimar2018-02-232-0/+46
| | | | | | | | | | | | This is relative to "Bug 36166 - tools/gold/X86/comdat.ll is failing only on Debian Unstable" (PR36166). Something changed in newer versions of gold and now together with gold-plugin there is an issue shown in PR, symbol may get wrong visibility. LLD works fine, but we have no testcase for the same use case, patch adds it. Differential revision: https://reviews.llvm.org/D43193 llvm-svn: 325874
* [ELF] - Add testcase documenting flags assigned when empty synthetic section ↵George Rimar2018-02-231-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is removed. This responds to PR36475, r325763 led to unexprected layout change, though new behavior seems to be more correct. Previously we could have following script: .foo : { *(.foo) } .bar : { *(.synthetic_empty) BYTE(0x11) }} where synthetic_empty is a synthetic section which is empty and hence removed by linker. Before r325763 .bar would receive section flags from .synthetic_empty, but after this revision it receives flags the same as .foo section has. It is the same as if there would not be any synthetic_empty section in a script, so looks reasonable and consistent behavior: .foo : { *(.foo) } .bar : { BYTE(0x11) }} Patch adds testcase to document it. Differential revision: https://reviews.llvm.org/D43632 llvm-svn: 325873
* ReleaseNotes: user lower-case for lld in the textHans Wennborg2018-02-231-3/+3
| | | | llvm-svn: 325869
* [WebAssembly] Add explicit symbol tableSam Clegg2018-02-2326-853/+1897
| | | | | | | | | | | | | | | | | | This change modified lld to in response the llvm change which moved to a more explicit symbol table in the object format. Based on patches by Nicholas Wilson: 1. https://reviews.llvm.org/D41955 2. https://reviews.llvm.org/D42585 The primary difference that we see in the test output is that for relocatable (-r) output we now have symbol table which replaces exports/imports and globals. See: https://github.com/WebAssembly/tool-conventions/issues/38 Differential Revision: https://reviews.llvm.org/D43264 llvm-svn: 325861
* [WebAssembly] Move lambda declaration output of loop. NFC.Sam Clegg2018-02-231-22/+24
| | | | | | Differential Revision: https://reviews.llvm.org/D43534 llvm-svn: 325857
* [ELF] Add comment for preemptible and fix typo. NFCFangrui Song2018-02-234-7/+8
| | | | | | | | Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D43642 llvm-svn: 325855
* Make undefined symbol in DSO to pull out object files from archive files.Rui Ueyama2018-02-232-2/+26
| | | | | | | | | | | | | | | | | | | We have an internal program that does't link without this patch. I don't know of any open-source program that needs this, but there might be. Since this patch improves compatibility with GNU linkers with a few lines of code, I think it's worth to be committed. The problem is about undefined symbols in DSOs. Some programs depend on the GNU linkers' behavior that they pull out object files from archive files to resolve undefined symbols in DSOs. We already allow that kind of "reverse" dependency (from DSOs to the main executable) for regular symbols, in particular, for "__progname" symbol (which is usually in crt0.o), but that doesn't work if the symbol is in an archive file. This patch is to make it work. Differential Revision: https://reviews.llvm.org/D43658 llvm-svn: 325849
* Update lld documentation to mention PDB support.Zachary Turner2018-02-221-3/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D43636 llvm-svn: 325821
* [ELF] - Rewrote outdated comment. NFC.George Rimar2018-02-221-2/+2
| | | | llvm-svn: 325809
* [ELF] - Introduce getInputSections() helper.George Rimar2018-02-225-40/+27
| | | | | | | | | | | We sometimes need to iterate over input sections for a given output section. It is not very convinent because we have to iterate over section descriptions. Patch introduces getInputSections helper, it simplifies things. Differential revision: https://reviews.llvm.org/D43574 llvm-svn: 325763
* Revert r325679: [ELF] Add -nopie alias for -no-pie (PR36423)Rui Ueyama2018-02-212-4/+1
| | | | | | | | | This reverts commit r325679 that was committed without discussion. Actually, in the discussion thread, most people opposed to have this option in lld. Reverting that change doesn't mean that this is a final decision, but that needs to be discussed first. llvm-svn: 325714
* [mips][lld] Address post commit review nit.Simon Dardis2018-02-211-3/+2
| | | | | | | Address @ruiu's post commit review comment about a value which is intended to be a unsigned 32 bit integer as using uint32_t rather than unsigned. llvm-svn: 325713
* [WebAssembly] Use make<> rather then make_unique<>. NFC.Sam Clegg2018-02-211-5/+4
| | | | | | | | | lld uses an arena allocator to one of allocations like these can just use make<>. Differential Revision: https://reviews.llvm.org/D43587 llvm-svn: 325706
* [WebAssembly] Rename member DefinedFunctions -> InputFunctions. NFC.Sam Clegg2018-02-211-16/+16
| | | | | | | | | This avoids confusion with the `DefinedFunction` symbol type. Differential Revision: https://reviews.llvm.org/D43588 llvm-svn: 325705
* [ELF] - Simplify. NFC.George Rimar2018-02-211-3/+1
| | | | llvm-svn: 325681
* [ELF] Add -nopie alias for -no-pie (PR36423)Hans Wennborg2018-02-212-1/+4
| | | | | | | | | | | | In r324043, --nopie was renamed to --no-pie to presumably fix a typo. As it turns out, "nopie" wasn't a typo but the spelling used by OpenBSD's binutils ld. Gold on the other hand spells the flag "no-pie". (Vanilla binutils doesn't have a flag like this at all.) Since they do the same thing, let's support both spellings. llvm-svn: 325679
* [ELF] - Simplify testcase. NFC.George Rimar2018-02-212-13/+10
| | | | | | | | This removes script input file and inlines script into testcase body. That is consistent with othet LS tests and makes testcase easier to read. llvm-svn: 325673
* [WebAssembly] Use stable sort when sorting ctore functionsSam Clegg2018-02-211-4/+4
| | | | | | Patch by Nicholas Wilson! llvm-svn: 325656
* [lit] Fix a problem with spaces in the python path by adding quotes around itAaron Smith2018-02-212-2/+2
| | | | | | | | | | | | | | | | Summary: This fixes two failing tests on Windows with an installed version of python that has spaces in the path. * elf/lto/cache.ll * mach-o/dependency_info.yaml Reviewers: zturner, llvm-commits, stella.stamenova Subscribers: emaste, arichardson Differential Revision: https://reviews.llvm.org/D43265 llvm-svn: 325650
* [mips][lld] Spectre variant two mitigation for MIPSR2Simon Dardis2018-02-205-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides migitation for CVE-2017-5715, Spectre variant two, which affects the P5600 and P6600. It implements the LLD part of -z hazardplt. Like the Clang part of this patch, I have opted for that specific option name in case alternative migitation methods are required in the future. The mitigation strategy suggested by MIPS for these processors is to use hazard barrier instructions. 'jalr.hb' and 'jr.hb' are hazard barrier variants of the 'jalr' and 'jr' instructions respectively. These instructions impede the execution of instruction stream until architecturally defined hazards (changes to the instruction stream, privileged registers which may affect execution) are cleared. These instructions in MIPS' designs are not speculated past. These instructions are defined by the MIPS32R2 ISA, so this mitigation method is not compatible with processors which implement an earlier revision of the MIPS ISA. For LLD, this changes PLT stubs to use 'jalr.hb' and 'jr.hb'. Reviewers: atanasyan, ruiu Differential Revision: https://reviews.llvm.org/D43488 llvm-svn: 325647
* [WebAssembly] Rename GlobalSymbol types. NFC.Sam Clegg2018-02-2010-93/+93
| | | | | | | | | | | | | | | Purely a rename in preparation for adding new global symbol type. We want to use GlobalSymbol to represent real wasm globals and DataSymbol for pointers to things in linear memory (what ELF would call STT_OBJECT). This reduces the size the patch to add the explicit symbol table which is coming soon! Differential Revision: https://reviews.llvm.org/D43476 llvm-svn: 325645
* Consistent use of header file for ICF and MarkLiveSam Clegg2018-02-2011-12/+80
| | | | | | | | | | Previously wasm used a separate header to declare markLive and ELF used to declare ICF. This change makes each backend consistently declare these in their own headers. Differential Revision: https://reviews.llvm.org/D43529 llvm-svn: 325631
* Consistent (non) use of empty lines in include blocksSam Clegg2018-02-2021-26/+5
| | | | | | | | | The profailing style in lld seem to be to not include such empty lines. Clang-tidy/clang-format seem to handle this just fine. Differential Revision: https://reviews.llvm.org/D43528 llvm-svn: 325629
* Use more early returns in SymbolTable.cpp.Rui Ueyama2018-02-201-33/+46
| | | | | | | | | | | I think if statements that end with return is easier to read than cascaded if-else-if-else-if statements because it makes clear that execution of a function terminates there. This patch also adds more blank lines to separate code blocks to meaningful pieces. Differential Revision: https://reviews.llvm.org/D43517 llvm-svn: 325625
* [WebAssembly] Remove unused headerSam Clegg2018-02-201-1/+1
| | | | llvm-svn: 325624
* [lld/LTO] Remove unused Path parameter to AddBufferFnTeresa Johnson2018-02-202-6/+7
| | | | | | | | | | | | | | | | Summary: With D43396, no clients use the Path parameter anymore. This is the lld side fix with D43400. Depends on D43396 and D43400. Reviewers: pcc Subscribers: emaste, inglorion, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D43401 llvm-svn: 325620
* feedbackSam Clegg2018-02-201-15/+8
| | | | llvm-svn: 325614
* [WebAssembly] Split addDefined into two different methods. NFC.Sam Clegg2018-02-203-42/+54
| | | | | | | | Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43496 llvm-svn: 325613
* [WebAssembly] Remove unused headerSam Clegg2018-02-202-2/+0
| | | | | | | | | This header used to be needed here for the `OutRelocation` struct but that no longer exists. Differential Revision: https://reviews.llvm.org/D43516 llvm-svn: 325608
OpenPOWER on IntegriCloud