summaryrefslogtreecommitdiffstats
path: root/lld
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r324322 "[ELF] - Use ↵George Rimar2018-02-062-14/+17
| | | | | | | | | InitTargetOptionsFromCodeGenFlags/ParseCommandLineOptions for parsing LTO options." It broke BB: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/8162 llvm-svn: 324332
* [ELF] - Use InitTargetOptionsFromCodeGenFlags/ParseCommandLineOptions for ↵George Rimar2018-02-062-17/+14
| | | | | | | | | | | | | | | | | parsing LTO options. gold plugin uses InitTargetOptionsFromCodeGenFlags + ParseCommandLineOptions for parsing LTO options. Patch do the same change for LLD. Such change helps to avoid parsing/whitelisting LTO plugin options again on linker side, what can help LLD to automatically support new -plugin-opt=xxx options passed. Differential revision: https://reviews.llvm.org/D42733 llvm-svn: 324322
* [COFF] Add minimal support for /guard:cfReid Kleckner2018-02-0614-53/+632
| | | | | | | | | | | | | | | | | | | Summary: This patch adds some initial support for Windows control flow guard. At the end of the day, the linker needs to synthesize a table of RVAs very similar to the structured exception handler table (/safeseh). Both /safeseh and /guard:cf take sections of symbol table indices (.sxdata and .gfids$y) and turn them into RVA tables referenced by the load config struct in the CRT through special symbols. Reviewers: ruiu, amccarth Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42592 llvm-svn: 324306
* Add -no-allow-multiple-definition, -no-pic-executable and -no-warn-common.Rui Ueyama2018-02-065-10/+15
| | | | | | | | GNU gold has these options. Differential Revision: https://reviews.llvm.org/D42929 llvm-svn: 324300
* Fix LLD wasm error check on Windows, which prints "lld.EXE: error: ..."Reid Kleckner2018-02-061-1/+1
| | | | llvm-svn: 324297
* Replace ApplyDynamicRelocs with WriteAddends.Rafael Espindola2018-02-053-7/+8
| | | | | | | The difference is that WriteAddends also takes IsRela into consideration. llvm-svn: 324271
* Change the default of --apply-dynamic-relocs.Rafael Espindola2018-02-053-3/+7
| | | | | | | | | | | | | When using Elf_Rela every tool should use the addend in the relocation. We have --apply-dynamic-relocs to work around bugs in tools that don't do that. The default value of --apply-dynamic-relocs should be false to make sure these bugs are more easily found in the future. llvm-svn: 324264
* Allow both -no-omagic and --no-omagic.Rui Ueyama2018-02-051-1/+1
| | | | | | | Any multi-character option that doesn't start with "o" should be allowed to start both with "-" and "--". llvm-svn: 324262
* [ELF] Implement --[no-]apply-dynamic-relocs option.Peter Smith2018-02-056-38/+85
| | | | | | | | | | | | | | | | When resolving dynamic RELA relocations the addend is taken from the relocation and not the place being relocated. Accordingly lld does not write the addend field to the place like it would for a REL relocation. Unfortunately there is some system software, in particlar dynamic loaders such as Bionic's linker64 that use the value of the place prior to relocation to find the offset that they have been loaded at. Both gold and bfd control this behavior with the --[no-]apply-dynamic-relocs option. This change implements the option and defaults it to true for compatibility with gold and bfd. Differential Revision: https://reviews.llvm.org/D42797 llvm-svn: 324221
* [ELF] - Report valid binary filename when reporting error.George Rimar2018-02-053-5/+5
| | | | | | | | | | We did not report valid filename for duplicate symbol error when symbol came from binary input file. Patch fixes it. Differential revision: https://reviews.llvm.org/D42635 llvm-svn: 324217
* [WebAssembly] Refactor linker-generated symbols. NFC.Sam Clegg2018-02-026-40/+62
| | | | | | | | | | | | Group all synthetic symbols in the in single struct to match the ELF linker. This change is part of a larger change to add more linker symbols such as `_end` and `_edata`. Differential Revision: https://reviews.llvm.org/D42866 llvm-svn: 324157
* Simplify.Rui Ueyama2018-02-021-2/+1
| | | | llvm-svn: 324155
* Update Eq so that it uses NAME just like B does. NFC.Rui Ueyama2018-02-021-2/+2
| | | | llvm-svn: 324154
* Add -{no,}-check-sections flags to enable/disable section overlcheckingRui Ueyama2018-02-025-2/+12
| | | | | | | | GNU linkers have this option. Differential Revision: https://reviews.llvm.org/D42858 llvm-svn: 324150
* Strip .note.gnu.build-id sections if --build-id is given.Rui Ueyama2018-02-022-0/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D42823 llvm-svn: 324146
* Add --no-gnu-unique and --no-undefined-version for completeness.Rui Ueyama2018-02-027-12/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D42865 llvm-svn: 324145
* Consolidate --foo and --no-foo options. NFC.Rui Ueyama2018-02-021-63/+47
| | | | | | Differential Revision: https://reviews.llvm.org/D42859 llvm-svn: 324141
* [ELF] - Reimplemented duplicated-synthetic-sym.s testcase.George Rimar2018-02-021-8/+13
| | | | | | | Was suggested during review of D42635, because linking an .s file as a binary file was confusing. llvm-svn: 324072
* [ELF][MIPS] Change format of output relocations to Elf_RelSimon Atanasyan2018-02-025-13/+12
| | | | | | | | | | | Initially LLD generates Elf_Rel relocations for O32 ABI and Elf_Rela relocations for N32 / N64 ABIs. In other words, format of input and output relocations was always the same. Now LLD generates all output relocations using Elf_Rel format only. It conforms to ABIs requirement. The patch suggested by Alexander Richardson. llvm-svn: 324064
* [WebAssembly] Fix typo in test fileSam Clegg2018-02-021-1/+1
| | | | llvm-svn: 324045
* Fix typo: --nopie -> --no-pie.Rui Ueyama2018-02-023-4/+4
| | | | | | | | | --nopie was a typo. GNU gold doesn't recognize it. It is also inconsistent with other options that have --foo and --no-foo. Differential Revision: https://reviews.llvm.org/D42825 llvm-svn: 324043
* [WebAssembly] Fix signature mismatches in test codeSam Clegg2018-02-0231-100/+100
| | | | | | | | | Pass --check-signatures to test executions of lld and fix resulting errors. Differential Revision: https://reviews.llvm.org/D42661 llvm-svn: 324042
* Don't accept unsuitable ELF files such as executables or core files.Rui Ueyama2018-02-024-6/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D42827 llvm-svn: 324041
* Relax the grammar of the version script.Rui Ueyama2018-02-012-8/+9
| | | | | | | | | In GNU linkers, the last semicolon is optional. We can't link libstdc++ with lld because of that difference. Differential Revision: https://reviews.llvm.org/D42820 llvm-svn: 324036
* Sort each InputSectionDescription individually.Rafael Espindola2018-02-012-3/+9
| | | | | | | | | This fixes pr36190. Thanks to James Henderson for the testcase and for pointing out how to fix this. llvm-svn: 323993
* [ELF] Add --print-icf-sections flagJames Henderson2018-02-0121-35/+115
| | | | | | | | | | | | | | | | | | | | | | | | | Currently ICF information is output through stderr if the "--verbose" flag is used. This differs to Gold for example, which uses an explicit flag to output this to stdout. This commit adds the "--print-icf-sections" and "--no-print-icf-sections" flags and changes the output message format for clarity and consistency with "--print-gc-sections". These messages are still output to stderr if using the verbose flag. However to avoid intermingled message output to console, this will not occur when the "--print-icf-sections" flag is used. Existing tests have been modified to expect the new message format from stderr. Patch by Owen Reynolds. Differential Revision: https://reviews.llvm.org/D42375 Reviewers: ruiu, rafael Reviewed by: llvm-svn: 323976
* Simplify by sorting relocations before writing them.Rafael Espindola2018-02-011-17/+7
| | | | llvm-svn: 323944
* [WebAssembly] Write minimal types sectionSam Clegg2018-01-317-46/+89
| | | | | | | | | | | | | | | | | | Don't include type signatures that are not referenced by some relocation. We don't include this in the -gc-sections settings since we are always building the type section from scratch, just like we do the table elements. In the future we might want to unify the relocation processing which is currently done once for gc-sections and then again for building the sympathetic type and table sections. Differential Revision: https://reviews.llvm.org/D42747 llvm-svn: 323931
* [COFF] make /incremental control overwriting unchanged import librariesBob Haarman2018-01-315-9/+97
| | | | | | | | | | | | | | | | | | | | | | Summary: r323164 made lld-link not overwrite import libraries when their contents haven't changed. MSVC's link.exe does this only when performing incremental linking. This change makes lld-link's import library overwriting similarly dependent on whether or not incremental linking is being performed. This is controlled by the /incremental or /incremental:no options. In addition, /opt:icf, /opt:ref, and /order turn off /incremental and issue a warning if /incremental was specified on the command line. Reviewers: rnk, ruiu, zturner Reviewed By: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42716 llvm-svn: 323930
* [WebAssembly] Update to match llvm change rL323901. NFCSam Clegg2018-01-314-9/+14
| | | | | | | | | | See: https://reviews.llvm.org/rL323901 Patch by Nicholas Wilson! Differential Revision: https://reviews.llvm.org/D42751 llvm-svn: 323903
* [PDB] Fix test failures due to expected warning not matching actual warning textColden Cullen2018-01-311-1/+1
| | | | llvm-svn: 323895
* [LLD][PDB] Implement FIXME: Warn on missing TypeServer PDB rather than errorColden Cullen2018-01-312-20/+42
| | | | | | | | | | | | | | Summary: Instead of fatal-ing out when missing a type server PDB, insead warn and cache the miss. Reviewers: rnk, zturner Reviewed By: rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42188 llvm-svn: 323893
* [ELF] Make overlapping output sections an errorAlexander Richardson2018-01-315-16/+285
| | | | | | | | | | | | | | | | | | | | | | | Summary: While trying to make a linker script behave the same way with lld as it did with bfd, I discovered that lld currently doesn't diagnose overlapping output sections. I was getting very strange runtime failures which I tracked down to overlapping sections in the resulting binary. When linking with ld.bfd overlapping output sections are an error unless --noinhibit-exec is passed and I believe lld should behave the same way here to avoid surprising crashes at runtime. The patch also uncovered an errors in the tests: arm-thumb-interwork-thunk was creating a binary where .got.plt was placed at an address overlapping with .got. Reviewers: ruiu, grimar, rafael Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D41046 llvm-svn: 323856
* [ELF] - Do not forget file name when reporting duplicate symbol error for ↵George Rimar2018-01-312-5/+6
| | | | | | | | | | | | absolute symbols. When there is a duplicate absolute symbol, LLD reports <internal> instead of known object file name currently. Patch fixes the issue. Differential revision: https://reviews.llvm.org/D42636 llvm-svn: 323849
* [LLD] Use Rela on PowerPC tooRui Ueyama2018-01-312-1/+13
| | | | | | | | | | | | | | | | Patch by Nicholas Allegra. The spec for ELF on PowerPC: http://refspecs.linux-foundation.org/elf/elfspec_ppc.pdf says: "The PowerPC family uses only the Elf32_Rela relocation entries with explicit addends." (EM_PPC64 should be covered by Config->Is64 already.) Differential Revision: https://reviews.llvm.org/D40826 llvm-svn: 323843
* [WebAssembly] Add support for --gc-sectionsSam Clegg2018-01-3117-21/+269
| | | | | | | | | | | | | | | In this initial version we only GC symbols with `hidden` visibility since other symbols we export to the embedder. We could potentially modify this the future and only use symbols explicitly passed via `--export` as GC roots. This version of the code only does GC of data and code. GC for the types section is coming soon. Differential Revision: https://reviews.llvm.org/D42511 llvm-svn: 323842
* [WebAssembly] Reduce redundancy in testsSam Clegg2018-01-316-26/+18
| | | | | | | | | | | | Add a simple start entry point input file and have the tests reference that rather than duplicating these. This allows more tests to be pure `.test` files rather than `.ll`. Differential Revision: https://reviews.llvm.org/D42662 llvm-svn: 323838
* Fix lit substitution in test.James Y Knight2018-01-301-2/+2
| | | | | | | There is no '%m' substitution, so a literal "%m.so" file was being generated in the source tree. llvm-svn: 323820
* Pass CPU string to LTO pipeline.Rafael Espindola2018-01-304-0/+27
| | | | | | | | | | Previously an empty CPU string was passed to the LTO engine which resulted in a generic CPU for which certain features like NOPL were disabled. This fixes that. Patch by Pratik Bhatu! llvm-svn: 323801
* Run dos2unix on another file. NFC.Rafael Espindola2018-01-301-18/+18
| | | | llvm-svn: 323796
* Run dos2unix in a few files. NFC.Rafael Espindola2018-01-305-54/+54
| | | | llvm-svn: 323793
* Move function to the file where it is used.Rafael Espindola2018-01-303-30/+27
| | | | llvm-svn: 323780
* Sort orphan section if --symbol-ordering-file is given.Rafael Espindola2018-01-306-36/+22
| | | | | | Before this patch orphan sections were not sorted. llvm-svn: 323779
* [ELF] - Remove dead declaration. NFC.George Rimar2018-01-301-1/+0
| | | | llvm-svn: 323747
* [ELF] - Define linkerscript symbols early.George Rimar2018-01-309-76/+157
| | | | | | | | | | | | | | | | Currently symbols assigned or created by linkerscript are not processed early enough. As a result it is not possible to version them or assign any other flags/properties. Patch creates Defined symbols for -defsym and linkerscript symbols early, so that issue from above can be addressed. It is based on Rafael Espindola's version of D38239 patch. Fixes PR34121. Differential revision: https://reviews.llvm.org/D41987 llvm-svn: 323729
* [COFF] Remove the temporary file if not updating the import libraryMartin Storsjo2018-01-301-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D42621 llvm-svn: 323725
* Warn on nonexistent comdat sections in an /order file.Rui Ueyama2018-01-292-5/+30
| | | | | | | | | | | | | I didn't implement the feature in the original patch because I didn't come up with an idea to do that easily and efficiently. Turned out that that is actually easy to implement. In this patch, we collect comdat sections before gc is run and warn on nonexistent symbols in an order file. Differential Revision: https://reviews.llvm.org/D42658 llvm-svn: 323699
* Update a help message.Rui Ueyama2018-01-291-1/+1
| | | | llvm-svn: 323698
* [DWARFv5] Re-enable dumping a line table with no CU.Paul Robinson2018-01-291-3/+1
| | | | | | | | | | | r323476 added support for DW_FORM_line_strp, and incorrectly made that depend on having a DWARFUnit available. We shouldn't be tracking .debug_line_str in DWARFUnit after all. After this patch, I can do an NFC follow up and undo a bunch of the "plumbing" part of r323476. Differential Revision: https://reviews.llvm.org/D42609 llvm-svn: 323691
* Remove trailing space.Rui Ueyama2018-01-291-1/+1
| | | | llvm-svn: 323682
OpenPOWER on IntegriCloud