summaryrefslogtreecommitdiffstats
path: root/lld
Commit message (Collapse)AuthorAgeFilesLines
...
* [ELF] - Convert overlapping-sections.s testcase to x86 and cleanup.George Rimar2018-03-141-85/+27
| | | | | | | | | | | | | | | Patch do the following changes: * Test case was converted from MIPS to x86. * Removed part of the test checking we are able to produce a valid output. Since we do that already in other tests, this one's intention should be only to check we are still able to report overlaps and/or produce broken output with overlaps. Differential revision: https://reviews.llvm.org/D44438 llvm-svn: 327480
* [WebAssembly] Fix expected contents of relocations with addendsSam Clegg2018-03-143-11/+40
| | | | | | | | | | | This fixes issues found on the wasm waterfall related to relocations with addends. Undefined symbols, even those with addends should always have a provisional value of zero. At least this is what llvm emits (and I believe this is true for ELF too). Differential Revision: https://reviews.llvm.org/D44451 llvm-svn: 327468
* [ELF} - Fix build bots.George Rimar2018-03-132-2/+2
| | | | llvm-svn: 327419
* [ELF] - Fix mistype in comment. NFC.George Rimar2018-03-131-1/+1
| | | | llvm-svn: 327417
* [ELF] - Rename test cases to *.test.George Rimar2018-03-1328-0/+0
| | | | | | This is a follow-up for r327410. llvm-svn: 327416
* [ELF] - Represent tests as linker scripts instead of asm.George Rimar2018-03-1328-200/+232
| | | | | | | | | This follows recently started direction and sometimes allows to fully get rid from `echo` calls. I'll rename changed files to *.test in a follow-up. llvm-svn: 327410
* [WebAssembly] Demangle symbol names for use by the browser debuggerNicholas Wilson2018-03-133-3/+75
| | | | | | Differential Revision: https://reviews.llvm.org/D44316 llvm-svn: 327392
* [WebAssembly] Use helper macro from ELF/Options.td to tidy. NFCNicholas Wilson2018-03-131-15/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D44394 llvm-svn: 327391
* [WebAssembly] Add missing --demangle argNicholas Wilson2018-03-133-0/+27
| | | | | | | | | Previously, Config->Demangle was uninitialised (not hooked up to commandline handling) Differential Revision: https://reviews.llvm.org/D44301 llvm-svn: 327390
* [ELF] - Implement INSERT BEFORE.George Rimar2018-03-136-16/+60
| | | | | | | | | | | This finishes PR35877. INSERT BEFORE used similar to INSERT AFTER, it inserts sections before the given target section. Differential revision: https://reviews.llvm.org/D44380 llvm-svn: 327378
* [ELF] - Fix wrong "REQUIRES" in test.George Rimar2018-03-131-1/+1
| | | | | | Its a follow up for r327374 to fix BB. llvm-svn: 327377
* [ELF] - Restrict section offsets that exceeds file size.George Rimar2018-03-133-6/+53
| | | | | | | | | | | | | | | | | This is part of PR36515. With some linkerscripts it is possible to get file offset overlaps and overflows. Currently LLD checks overlaps in checkNoOverlappingSections(). And also we allow broken output with --no-inhibit-exec. Problem is that sometimes final offset of sections is completely broken and we calculate output file size wrong and might crash. Patch implements check to verify that there is no output section which offset exceeds file size. Differential revision: https://reviews.llvm.org/D43819 llvm-svn: 327376
* [ELF] - Drop special flags for empty output sections.George Rimar2018-03-132-7/+32
| | | | | | | | | | | | | | | | This fixes PR36598. LLD currently crashes when we have empty output section with SHF_LINK_ORDER flag. This might happen if we place an empty synthetic section in the linker script, but keep output section alive with the use of additional symbol, for example. The patch fixes the issue by dropping all special flags for empty sections. Differential revision: https://reviews.llvm.org/D44376 llvm-svn: 327374
* Use PLT relocations in test.Rafael Espindola2018-03-131-4/+4
| | | | | | | | Currently lld creates plain plt entries when a R_386_PC32 resolves to a symbol in a shared library. That is a bug (PR36678). Don't depend on that behavior on this test. llvm-svn: 327357
* [lld] Fix comdat testsAlexander Shaposhnikov2018-03-133-0/+10
| | | | | | | This diff adjusts the comdat tests after changing the format of llvm-readobj output for .group sections. llvm-svn: 327353
* [WebAssembly] Refactor to avoid conflating global and fucntion index space. NFCSam Clegg2018-03-127-88/+96
| | | | | | Differential Revision: https://reviews.llvm.org/D44358 llvm-svn: 327326
* [WebAssembly] Verify contents of relocation target before writing itSam Clegg2018-03-123-0/+61
| | | | | | | | | | | | Verify that the location where a relocation is about the be applied contains the expected existing value. This is essentially a sanity check to catch bugs in the compiler and the linker. Differential Revision: https://reviews.llvm.org/D44349 llvm-svn: 327325
* [WebAssembly] Add test for imported ctor and fix indexing bug foundNicholas Wilson2018-03-122-80/+134
| | | | | | | | | This bug was found by accident while trying to expand out testcases for imported symbols, and is covered by the additional test case. Differential Revision: https://reviews.llvm.org/D44331 llvm-svn: 327290
* [WebAssembly] Reorder synthetic functions to come firstNicholas Wilson2018-03-1219-252/+261
| | | | | | | | | This matches the existing ordering that's been there for globals for a while (__stack_pointer coming first). Differential Revision: https://reviews.llvm.org/D44333 llvm-svn: 327286
* [ELF] - Formatted comment, fixed mistype. NFC.George Rimar2018-03-121-3/+2
| | | | llvm-svn: 327280
* [ELF] - Removed excessive lookup. NFC.George Rimar2018-03-121-3/+2
| | | | llvm-svn: 327272
* Make lld-link shout at me less.Nico Weber2018-03-124-15/+15
| | | | | | | | | This makes the output of some flag names in warning messages consistent with the output of /? and the output of flags in most other diagnostics. https://reviews.llvm.org/D44307 llvm-svn: 327261
* [ELF] - Change consume()->expect() in INSERT AFTER parsing.George Rimar2018-03-122-1/+7
| | | | | | | | AFTER keyword is mandatory and consume() was used by mistake here. We accepted broken script before this patch, testcase shows the issue. llvm-svn: 327260
* [lld-link] For suppressible warnings, print the warning number.Nico Weber2018-03-122-3/+3
| | | | | | | The warning can be suppressed by passing the number to /ignore:. https://reviews.llvm.org/D44297 llvm-svn: 327257
* For most Targets the _GLOBAL_OFFSET_TABLE_ symbol is expected to be atPeter Smith2018-03-1117-42/+85
| | | | | | | | | | | | | | | | | | the start of the .got.plt section so that _GLOBAL_OFFSET_TABLE_[0] = reserved value that is by convention the address of the dynamic section. Previously we had defined _GLOBAL_OFFSET_TABLE_ as either the start or end of the .got section with the intention that the .got.plt section would follow the .got. However this does not always hold with the current default section ordering so _GLOBAL_OFFSET_TABLE_[0] may not be consistent with the reserved first entry of the .got.plt. X86, X86_64, Arm and AArch64 will use the .got.plt. Mips and Power use .got Fixes PR36555 Differential Revision: https://reviews.llvm.org/D44259 llvm-svn: 327248
* [WebAssembly] Improve logging and comments around relocations. NFC.Sam Clegg2018-03-112-8/+16
| | | | | | Differential Revision: https://reviews.llvm.org/D44350 llvm-svn: 327232
* [WebAssembly] Remove a second parameter from toString().Rui Ueyama2018-03-093-5/+4
| | | | | | | | | | | | toString(T) is a stringize function for an object of type T. Each type that has that function defined should know how to stringize itself, and there should be one string representation of an object. Passing a "supplemental" argument to toString() breaks that princple. We shouldn't add a second parameter to that function. Differential Revision: https://reviews.llvm.org/D44323 llvm-svn: 327182
* [ELF] Add elf64lppc emulation.Fangrui Song2018-03-092-0/+32
| | | | | | | | Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D44264 llvm-svn: 327177
* [ELF] Convert {read,write}*be to endianness-aware read/write.Fangrui Song2018-03-094-45/+66
| | | | | | | | Subscribers: emaste, nemanjai, arichardson, kbarton, llvm-commits Differential Revision: https://reviews.llvm.org/D44227 llvm-svn: 327156
* ELF: Do not create multiple thunks for the same virtual address.Peter Collingbourne2018-03-093-54/+83
| | | | | | | | | | This avoids creating multiple thunks for symbols with aliases or which belong to ICF'd sections. This patch reduces the size of Chromium for Android by 260KB (0.8% of .text). Differential Revision: https://reviews.llvm.org/D44284 llvm-svn: 327154
* [WebAssembly] Handle weak undefined functions with a synthetic stubNicholas Wilson2018-03-096-13/+183
| | | | | | | | | This error case is described in Linking.md. The operand for call requires generation of a synthetic stub. Differential Revision: https://reviews.llvm.org/D44028 llvm-svn: 327151
* [WebAssembly] Refactor order of creation for SyntheticFunctionNicholas Wilson2018-03-096-36/+45
| | | | | | | | | | Previously we created __wasm_call_ctors with null InputFunction, and added the InputFunction later. Now we create the SyntheticFunction with null body, and set the body later. Differential Revision: https://reviews.llvm.org/D44206 llvm-svn: 327149
* [CMake] Properly conditionalize installation of lld librariesDavid Zarzycki2018-03-091-1/+1
| | | | | | | | | | | | | | In what appears to be a copy-and-paste error, lld currently only installs libraries if the lld tools are configured to build. Instead, lld should allow the libraries to be installed even if the lld tools are not being built. Additionally, if users want to only install the tools and not the libraries, the LLVM way of doing that is by checking for LLVM_INSTALL_TOOLCHAIN_ONLY. This fixes PR35960. llvm-svn: 327126
* [lld-link] Add support for /ignore:4037.Nico Weber2018-03-093-4/+16
| | | | | | | Fixes PR36657. https://reviews.llvm.org/D44286 llvm-svn: 327124
* Resubmit "Write a hash of the executable into the PE timestamp fields."Zachary Turner2018-03-084-18/+54
| | | | | | | | | This fixes the broken tests that were causing failures. The tests before were verifying that the time stamp was 0, but now that we are actually writing a timestamp, I just removed the match against the timestamp value. llvm-svn: 327049
* [ELF] - Fix crash relative to SHF_LINK_ORDER sections.George Rimar2018-03-086-14/+50
| | | | | | | | | | | | | | | | | Our code assumes all input sections in an output SHF_LINK_ORDER section has SHF_LINK_ORDER flag. We do not check that and that can cause a crash. That happens because we call std::stable_sort(Sections.begin(), Sections.end(), compareByFilePosition);, where compareByFilePosition predicate does not expect to see null when calls getLinkOrderDep. The same might happen when sections refer to non-regular sections. Test cases demonstrate the issues, patch fixes them. Differential revision: https://reviews.llvm.org/D44193 llvm-svn: 327006
* [ELF] - Support "INSERT AFTER" statement.George Rimar2018-03-087-1/+87
| | | | | | | | | | | | | | | | | | | | This implements INSERT AFTER in a following way: During reading scripts it collects all insert statements. After we done and read all files it inserts statements into script commands list. With that: * Rest of code does know nothing about INSERT. * Approach is straightforward and have no visible limitations. * It is also easy to support INSERT BEFORE (was seen in clang code once). * Should work for PR35877 and similar cases. Cons: * It assumes we have "main" scripts that describes sections. Differential revision: https://reviews.llvm.org/D43468 llvm-svn: 327003
* [COFF] Make the DOS stub a real DOS programHans Wennborg2018-03-082-8/+52
| | | | | | | | It only adds a few bytes and is nice for backward compatibility. Differential Revision: https://reviews.llvm.org/D44018 llvm-svn: 327001
* [WebAssembly] Add except_ref as a first-class typeHeejin Ahn2018-03-081-0/+2
| | | | | | | | | | | | | | Summary: Add except_ref as a first-class type, according to the [[https://github.com/WebAssembly/exception-handling/blob/master/proposals/Level-1.md | Level 1 exception handling proposal ]]. Companion to D43706. Reviewers: sbc100 Subscribers: jfb, dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43707 llvm-svn: 326986
* Return early. NFC.Rui Ueyama2018-03-081-0/+1
| | | | | | | | We don't need to handle an object file having more than one symbol table, so as soon as we find the first one, we can process it and then return from the function. llvm-svn: 326977
* [WebAssembly] Honor --allow-undefined even for explicit exportsSam Clegg2018-03-082-2/+5
| | | | | | | | | | | | | | | | When a symbol is exported via --export=foo but --allow-undefined is also specified, the symbol is now allowed to be undefined. Previously we were special casing such symbols. This combinations of behavior is exactly what emescripten requires. Although we are trying hard not to allow emscripten specific features in lld, this one makes sense. Enforce this behavior by added this case to test/wasm/undefined.ll. Differential Revision: https://reviews.llvm.org/D44237 llvm-svn: 326976
* Simplify LazyobjFile and readElfSymbols.Rui Ueyama2018-03-082-48/+35
| | | | | | | | | | addElfSymbols and readJustSymbolsFile still has duplicate code, but I didn't come up with a good idea to eliminate them. Since this patch is an improvement, I'm sending this for review. Differential Revision: https://reviews.llvm.org/D44187 llvm-svn: 326972
* [ELF] Update test/ELF/eh-frame-hdr-augmentation.sFangrui Song2018-03-071-0/+2
| | | | llvm-svn: 326944
* Revert "Write a hash of the executable into the PE timestamp fields."Zachary Turner2018-03-071-50/+14
| | | | | | | This is breaking a couple of tests, so I'm reverting temporarily until I can get everything resolved properly. llvm-svn: 326943
* Use exact uint32_t for uint32_t ELF field. NFC.Rui Ueyama2018-03-073-3/+3
| | | | llvm-svn: 326934
* Initialize a member in C++11 style. NFC.Rui Ueyama2018-03-072-4/+2
| | | | llvm-svn: 326933
* [lld] Attempt to appease buildbot.Matt Morehouse2018-03-071-2/+2
| | | | | | r326903 broke the conflict-debug-variable.s test. llvm-svn: 326931
* Write a hash of the executable into the PE timestamp fields.Zachary Turner2018-03-071-14/+50
| | | | | | | | | | | | | | | | Windows tools treats the timestamp fields as sort of a build id, using it to archive executables on a symbol server, as well as for matching executables to PDBs. We were writing 0 for these fields, which would cause symbol servers to break as they are indexed in the symbol server based on this value. Although the field is called timestamp, it can really be any value that is unique per build, so to support reproducible builds we use a hash of the executable here. Differential Revision: https://reviews.llvm.org/D43978 llvm-svn: 326920
* [ELF] - Adjust rangeToString to report ranges in a different format.George Rimar2018-03-072-11/+11
| | | | | | | | | | | | | It was raised during the review of D43819. LLD usually use [X, Y] for reporting ranges, like below: "relocation R_386_16 out of range: 65536 is not in [0, 65535]" Patch changes rangeToString() to do the same. Differential revision: https://reviews.llvm.org/D44207 llvm-svn: 326918
* Revert r326911: Improve --warn-symbol-ordering.Rui Ueyama2018-03-073-30/+24
| | | | | | This reverts commit r326911 because it was committed by accident. llvm-svn: 326914
OpenPOWER on IntegriCloud