summaryrefslogtreecommitdiffstats
path: root/lld
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF][HEXAGON] Add R_HEX_B9_PCREL and R_HEX_B9_PCREL_X relocation supportSid Manning2018-08-252-0/+16
| | | | | | Differential Revision: https://reviews.llvm.org/D51045 llvm-svn: 340692
* [Common] Discard the temp file while keeping the memory mapping open, on errorsMartin Storsjo2018-08-241-2/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D51095 llvm-svn: 340635
* Modify tests to show PLT entry labelsJoel Galenson2018-08-2410-5/+59
| | | | llvm-svn: 340616
* Attempt to fix ELF/lto-plugin-ignore.s on Windows after r340487.Nico Weber2018-08-241-2/+2
| | | | | | | I removed the ".exe" regex in the wrong place. lld-link in front of the "error:" no longer has the suffix; the --plugin-opt diagnostic still has it. llvm-svn: 340590
* Revert "[PPC64] Fix DQ-form instruction handling and emit error for misalign..."Sean Fertile2018-08-234-119/+7
| | | | | | | | This reverts commit 5125b44dbb5d06b715213e4bec75c7346bfcc7d3. ppc64-dq.s and ppc64-error-missaligned-dq.s fail on several of the build-bots. Reverting to investigate. llvm-svn: 340568
* [PPC64] Fix DQ-form instruction handling and emit error for misalignment.Sean Fertile2018-08-234-7/+119
| | | | | | | | | | | Fixes the handling of *_DS relocations used on DQ-form instructions where we were overwriting some of the extended opcode bits. Also adds an alignment check so that the user will receive a diagnostic error if the value we are writing is not properly aligned. Differential Revision: https://reviews.llvm.org/D51124 llvm-svn: 340564
* COFF: Implement safe ICF on rodata using address-significance tables.Peter Collingbourne2018-08-237-2/+105
| | | | | | Differential Revision: https://reviews.llvm.org/D51050 llvm-svn: 340555
* win: Omit ".exe" from lld warning and error messages.Nico Weber2018-08-227-6/+16
| | | | | | | | | | | This is a minor follow-up to https://reviews.llvm.org/D49189. On Windows, lld used to print "lld-link.exe: error: ...". Now it just prints "lld-link: error: ...". This matches what link.exe does (it prints "LINK : ...") and makes lld's output less dependent on the host system. https://reviews.llvm.org/D51133 llvm-svn: 340487
* lld-link: Separate 'undefined symbol' errors with just one newline, not two.Nico Weber2018-08-223-10/+9
| | | | | | | | | | | | | newline() in ErrorHandler.cpp already tries to insert newlines between messages that contain embedded newlines, so getSymbolLocations() shouldn't return a string that ends in a newline -- else we end up with two newlines between error messages. Makes lld-link's output look more like ld.lld output. https://reviews.llvm.org/D51117 llvm-svn: 340482
* Fix two RUN: lines that were unintentionally spelled "RN:".Nico Weber2018-08-221-3/+3
| | | | | | https://reviews.llvm.org/D51140 llvm-svn: 340481
* [WebAssembly] Optimise relocation processing. NFC.Sam Clegg2018-08-223-37/+52
| | | | | | | | | | | | | | | | | This is a rebased version https://reviews.llvm.org/D42176 which is patch by Nicolas Wilson. Addresses issue: https://github.com/WebAssembly/tool-conventions/issues/32, and https://bugs.llvm.org/show_bug.cgi?id=38650 Previously, for each function/segment we iterated over every relocation to find the relevant ones, which is an n^2 operation. Now, we just make a single pass. Differential Revision: https://reviews.llvm.org/D51063 llvm-svn: 340428
* lld-link: Emit warning if one each of {main,wmain} and {WinMain,wWinMain} ↵Nico Weber2018-08-222-2/+66
| | | | | | | | | exist and no /subsystem: flag is passed. Similar to link.exe's LNK4031. https://reviews.llvm.org/D51076 llvm-svn: 340420
* [ELF][HEXAGON] Add R_HEX_16_X relocationSid Manning2018-08-222-0/+35
| | | | | | | | This relocation has only 6-bits the remaining are in the extender. Differential Revision: https://reviews.llvm.org/D50603 llvm-svn: 340413
* [COFF] Move a comment close to the code it refers to. NFC.Martin Storsjo2018-08-221-3/+3
| | | | llvm-svn: 340400
* [COFF] Change fatal() into error() when writing chunks to the outputMartin Storsjo2018-08-221-15/+20
| | | | | | | | | | In most of these cases, it's easy to go on despite the error, printing as many valuable error messages as possible from one run as possible. Differential Revision: https://reviews.llvm.org/D51087 llvm-svn: 340399
* Change how we handle -wrap.Rui Ueyama2018-08-2210-131/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have an issue with -wrap that the option doesn't work well when renamed symbols get PLT entries. I'll explain what is the issue and how this patch solves it. For one -wrap option, we have three symbols: foo, wrap_foo and real_foo. Currently, we use memcpy to overwrite wrapped symbols so that they get the same contents. This works in most cases but doesn't when the relocation processor sets some flags in the symbol. memcpy'ed symbols are just aliases, so they always have to have the same contents, but the relocation processor breaks that assumption. r336609 is an attempt to fix the issue by memcpy'ing again after processing relocations, so that symbols that are out of sync get the same contents again. That works in most cases as well, but it breaks ASan build in a mysterious way. We could probably fix the issue by choosing symbol attributes that need to be copied after they are updated. But it feels too complicated to me. So, in this patch, I fixed it once and for all. With this patch, we no longer memcpy symbols. All references to renamed symbols point to new symbols after wrapSymbols() is done. Differential Revision: https://reviews.llvm.org/D50569 llvm-svn: 340387
* [Support][CachePruning] prune least recently accessed files firstBob Haarman2018-08-221-0/+14
| | | | | | | | | | | | | | | | | Summary: Before this change, pruning order was based on size. This changes it to be based on time of last use instead, preferring to keep recently used files and prune older ones. Reviewers: pcc, rnk, espindola Reviewed By: rnk Subscribers: emaste, arichardson, hiraditya, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D51062 llvm-svn: 340374
* [ELF] -thinlto-object-suffix-replace=: don't error if the path does not end ↵Fangrui Song2018-08-212-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with old suffix Summary: For -thinlto-object-suffix-replace=old\;new, in tools/gold/gold-plugin.cpp, the thinlto object filename is Path minus optional old suffix. static std::string getThinLTOObjectFileName(StringRef Path, StringRef OldSuffix, StringRef NewSuffix) { if (OldSuffix.empty() && NewSuffix.empty()) return Path; StringRef NewPath = Path; NewPath.consume_back(OldSuffix); std::string NewNewPath = NewPath; NewNewPath += NewSuffix; return NewNewPath; } Currently lld will error that the path does not end with old suffix. This patch makes lld accept such paths but only add new suffix if Path ends with old suffix. This fixes a link error where bitcode members in an archive are regular LTO objects without old suffix. Acording to tejohnson, this will "enable supporting mix and match of minimized ThinLTO bitcode files with normal ThinLTO bitcode files in a single link (where we want to apply the suffix replacement to the minimized files, and just ignore it for the normal ThinLTO files)." Reviewers: ruiu, pcc, tejohnson, espindola Reviewed By: tejohnson Subscribers: emaste, inglorion, arichardson, eraman, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D51055 llvm-svn: 340364
* [PPC64] Add TLS initial exec to local exec relaxationZaara Syeda2018-08-215-3/+277
| | | | | | | | | This patch adds the target call back relaxTlsIeToLe to support TLS relaxation from initial exec to local exec model. Differential Revision: https://reviews.llvm.org/D48091 llvm-svn: 340281
* [LLD][ELF] - Fix BB after r340257.George Rimar2018-08-211-1/+1
| | | | | | Renamed Filecheck->FileCheck. llvm-svn: 340259
* [LLD][ELF] - Check the architecture of lazy objects earlier.George Rimar2018-08-213-18/+9
| | | | | | | | | | | | | | | | | | | | | | Our code in LazyObjFile::parse() has an ELFT switch and adds a lazy object by its ELFT kind. Though it might be possible to add a file using a different architecture and make LLD to silently accept it (if the file is empty or contains only week symbols). That itself, not a huge issue perhaps (because the error would be reported later if the file is fetched), but still does not look clean and correct. It is possible to report an error earlier and clean up the code. That is what the patch does. Ideally, we might want to reuse isCompatible from SymbolTable.cpp, but it is static and accepts a file as an argument, what is not convenient. Since such a situation should be rare, I think it should be OK to go with the way chosen in this patch. Differential revision: https://reviews.llvm.org/D50899 llvm-svn: 340257
* [docs] Add --print-icf-sections to ld.lld.1Fangrui Song2018-08-211-0/+2
| | | | llvm-svn: 340253
* [LLD][ELF] - Fix warning.George Rimar2018-08-201-1/+2
| | | | | | | | | This fixes the following warning when compiling with gcc version 8.0.1 20180319 (experimental) (GCC): /home/umb/LLVM/llvm/tools/lld/ELF/SyntheticSections.cpp:1951:46: warning: enumeral and non-enumeral type in conditional expression [-Wextra] return OS->SectionIndex >= SHN_LORESERVE ? SHN_XINDEX : OS->SectionIndex; llvm-svn: 340164
* [ELF] Add support for Armv5 and Armv6 compatible ThunksPeter Smith2018-08-2026-79/+345
| | | | | | | | | | | | | | | | Older Arm architectures do not support the MOVT and MOVW instructions so we must use an alternative sequence of instructions to transfer control to the destination. Assuming at least Armv5 this patch adds support for Thunks that load or add to the program counter. Note that there are no Armv5 Thumb Thunks as there is no Thumb branch instruction in Armv5 that supports Thunks. These thunks will not work for Armv4t (arm7tdmi) as this architecture cannot change state from using the LDR or ADD instruction. Differential Revision: https://reviews.llvm.org/D50077 llvm-svn: 340160
* [ELF] Add support for older Arm Architectures with smaller branch rangePeter Smith2018-08-2015-25/+87
| | | | | | | | | | | | | | The Thumb BL and BLX instructions on older Arm Architectures such as v5 and v6 have a constrained encoding J1 and J2 must equal 1, later Architectures relaxed this restriction allowing J1 and J2 to be used to calculate a larger immediate. This patch adds support for the old encoding, it is used when the build attributes for the input objects only contain older architectures. Differential Revision: https://reviews.llvm.org/D50076 llvm-svn: 340159
* Remove unnecessary applyMask() application.Rui Ueyama2018-08-201-1/+1
| | | | | | applyMask(0xffffffff, x) is an identity function. llvm-svn: 340152
* [WebAssembly] Don't compress LEBs by defaultSam Clegg2018-08-173-3/+15
| | | | | | | | | LEB compression breaks debug info so we don't want to enable it by default, even at high optimization levels. Differential Revision: https://reviews.llvm.org/D50729 llvm-svn: 340073
* [LLD][ELF] - Remove dead code. NFC.George Rimar2018-08-171-4/+0
| | | | | | These lines were unused. llvm-svn: 340011
* Update LLD tests for CodeView dumper change in r339907Reid Kleckner2018-08-168-20/+20
| | | | llvm-svn: 339913
* [codeview] Use push_macro to avoid conflicts instead of a prefixReid Kleckner2018-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: This prefix was added in r333421, and it changed our dumper output to say things like "CVRegEAX" instead of just "EAX". That's a functional change that I'd rather avoid. I tested GCC, Clang, and MSVC, and all of them support #pragma push_macro. They don't issue warnings whem the macro is not defined either. I don't have a Mac so I can't test the real termios.h header, but I looked at the termios.h sources online and looked for other conflicts. I saw only the CR* macros, so those are the ones we work around. Reviewers: zturner, JDevlieghere Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D50851 llvm-svn: 339907
* [ELF] mergeSections: remove non-alive MergeInputSectionFangrui Song2018-08-162-4/+10
| | | | | | | | | | | | | | Summary: This makes it conform to what the comment says. Otherwise when getErrPlace() is called afterwards, cast<InputSection>(D) will cause incompatible cast as MergeInputSection is not a subclass of InputSection. Reviewers: ruiu, grimar, espindola, pcc Reviewed By: grimar Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D50742 llvm-svn: 339904
* [LLD][ELF] - Add a test case for DT_SONAME entry reading.George Rimar2018-08-161-0/+18
| | | | | | | This covers a following line with a test: https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L899 llvm-svn: 339880
* [LLD][ELF] - Add a test case.George Rimar2018-08-161-0/+16
| | | | | | | This covers the following line with a test: https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L487 llvm-svn: 339876
* [LLD][ELF] - Add test case.George Rimar2018-08-161-0/+22
| | | | | | | To cover the following error message: https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L463 llvm-svn: 339867
* [LLD][ELF] - Stop using binary input in merge-invalid-size.s test. NFCI.George Rimar2018-08-153-3/+21
| | | | | | This rewrites the test using yaml. llvm-svn: 339775
* [LLD][ELF] - Convert binary input to yaml in sht-group.s test. NFC.George Rimar2018-08-153-3/+18
| | | | | | This removes test that used binary input and adds a yaml based test instead. llvm-svn: 339774
* [LLD][ELF] - Handle SHT_GROUP more carefully. NFCI.George Rimar2018-08-152-1/+30
| | | | | | | | | | | | This patch solves 2 problems: 1) It adds a test to check the line below: https://github.com/llvm-mirror/lld/blob/master/ELF/InputFiles.cpp#L334 Test case contains SHT_GROUP section with a broken (0xFF) flag. 2) The patch fixes the case when we silently accepted such broken groups in the case when there were no other objects with the same group signature. llvm-svn: 339765
* [LLD][ELF] - Eliminate dead code from OffsetGetter::get().George Rimar2018-08-142-1/+32
| | | | | | | | | We have a dead piece of code there which is impossible to trigger using regular objects I believe. Patch removes it and adds a test case showing how this condition can be triggered with use of a broken object and crash the linker. llvm-svn: 339680
* [ELF][HEXAGON] Add R_HEX_32 supportSid Manning2018-08-142-0/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D50657 llvm-svn: 339677
* [LLD][ELF] - Remove UnresolvedPolicy::IgnoreAll and relative code. NFC.George Rimar2018-08-143-7/+1
| | | | | | | | The code involved was simply dead. `IgnoreAll` value is used in `maybeReportUndefined` only which is never called for -r. And at the same time `IgnoreAll` was set only for -r. llvm-svn: 339672
* Revert r339490 to match revert of llvm r339474 in r339630.Richard Smith2018-08-142-4/+4
| | | | llvm-svn: 339635
* Support shared objects for split stack.Sterling Augustine2018-08-132-9/+44
| | | | llvm-svn: 339626
* [LLD][ELF] - Remove dead code from handleTlsRelocation. NFC.George Rimar2018-08-131-2/+0
| | | | | | | | Code is dead because R_TLSDESC_CALL is already handled in the following block of the code: https://github.com/llvm-mirror/lld/blob/master/ELF/Relocations.cpp#L231 llvm-svn: 339566
* [LLD][ELF] - Remove dead code from handleTlsRelocation. NFC.George Rimar2018-08-131-3/+0
| | | | | | | | | | That piece of code is really very old and "protected" from TLS relocations against symbol in non-allocatable sections. It is useless because normally non-alloc sections have relocations with allocatable targets, but not the reverse. And so the code was simply dead. llvm-svn: 339553
* [LLD][ELF] - Update test case to check the error message reported. NFC.George Rimar2018-08-131-1/+6
| | | | | | | | | | This updates znotext-plt-relocations-protected.s test case (adds a file symbol) to check how the error message is built. It allows to cover/test the following line: https://github.com/llvm-mirror/lld/blob/master/ELF/Relocations.cpp#L79 llvm-svn: 339550
* [LLD][ELF] - Add one more test case for CallGraphSort.George Rimar2018-08-121-0/+38
| | | | | | | This adds a coverage for the following early continue: https://github.com/llvm-mirror/lld/blob/master/ELF/CallGraphSort.cpp#L200 llvm-svn: 339514
* [LLF][ELF] - Simplify. NFC.George Rimar2018-08-121-3/+3
| | | | llvm-svn: 339510
* Fix WebAssembly tests after r339474Richard Trieu2018-08-102-4/+4
| | | | | | Add flags to llc RUN lines to keep tests passing. llvm-svn: 339490
* [ELF][HEXAGON] Put test back in.Sid Manning2018-08-101-3/+2
| | | | | | The registers are tied. llvm-svn: 339487
* [ELF][HEXAGON] Remove test that breaks assembler.Sid Manning2018-08-101-2/+3
| | | | | | | Remove testcase the breaks the assembler parser. Will fix llvm-mc and put this back afterward. llvm-svn: 339486
OpenPOWER on IntegriCloud