- Feb 21, 2017
-
-
George Rimar authored
Patch fixes PR32024. Sections that were not marked as Live has null output section. Previously we tried to access that field and segfaulted. Differential revision: https://reviews.llvm.org/D30188 llvm-svn: 295727
-
Ed Schouten authored
r295240 tweaked LLD to generate a symbol table when passing in --export-dynamic, even when creating static executables. Add a test to make sure this never regresses. Reviewed by: ruiu, rafael Differential Revision: https://reviews.llvm.org/D30175 llvm-svn: 295725
-
George Rimar authored
llvm-svn: 295724
-
George Rimar authored
Previously we evaluated the values of LMA incorrectly for next cases: .text : AT(ADDR(.text) - 0xffffffff80000000) { ... } .data : AT(ADDR(.data) - 0xffffffff80000000) { ... } .init.begin : AT(ADDR(.init.begin) - 0xffffffff80000000) { ... } Reason was that we evaluated offset when VA was not assigned. For case above we ended up with 3 loads that has similar LMA and it was incorrect. That is critical for linux kernel. Patch updates the offset after VA calculation. That fixes the issue. Differential revision: https://reviews.llvm.org/D30163 llvm-svn: 295722
-
George Rimar authored
Previously LLD would error out just "ld.lld: error: unable to move location counter backward" What does not really reveal the place of issue, Patch adds location to the output. Differential revision: https://reviews.llvm.org/D30187 llvm-svn: 295720
-
George Rimar authored
Previously ASSERT we implemented returned expression value. Ex: . = ASSERT(0x100); would set Dot value to 0x100 Form of assert when it is assigned to Dot was implemented for compatibility with very old GNU ld which required it. Some scripts in the wild, including linux kernel scripts use such ASSERTs at the end for doing different checks. Currently we fail with "unable to move location counter backward" for such scripts. Patch changes ASSERT to return location counter value to fix that. Differential revision: https://reviews.llvm.org/D30171 llvm-svn: 295703
-
- Feb 20, 2017
-
-
Peter Smith authored
This change moves the SymbolBodies with isLocal() == true before the global symbols then calculating NumLocals rather than assuming all locals are added before globals and the first NumLocals have isLocal() == true. This permits Thunks to be moved after the pass that adds global symbols from synthetics to the symbol table. Differential revision: https://reviews.llvm.org/D30085 llvm-svn: 295650
-
Rui Ueyama authored
llvm-svn: 295633
-
Rui Ueyama authored
llvm-svn: 295632
-
- Feb 19, 2017
-
-
Rui Ueyama authored
llvm-svn: 295622
-
David Blaikie authored
Behavior races on ErrorCount. If the enqueued paths are evaluated eagerly (in enqueuePath) then the behavior is as the test expects. But they may not be evaluated until the future is waited on, in run() - which is after the early return/exit on ErrorCount. (this causes the test to fail (because in the "/ERRORCOUNT:XYZ" test, no other errors are printed), at least for me, on linux) This reverts commit r295507. llvm-svn: 295590
-
- Feb 17, 2017
-
-
Bob Haarman authored
Summary: This adds support for reporting multiple errors in a single invocation of lld-link. The limit defaults to 20 and can be changed with the /ERRORLIMIT command line parameter, or set to unlimited by passing a value of 0. Reviewers: pcc, ruiu Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D29691 llvm-svn: 295507
-
George Rimar authored
Previously LLD crashed on on provided testcases because "/DISCARD/" was not supported. Patch implements that. After this I think there is no known issues with --emit-relocs implementation required for linux kernel linking. Differential revision: https://reviews.llvm.org/D29273 llvm-svn: 295488
-
Rafael Espindola authored
Before it would never print anything. Thanks to George Rimar for pointing it out. llvm-svn: 295485
-
George Rimar authored
I splitted it from D29273. Since we plan to make relocatable sections as dependent for target ones for --emit-relocs implementation, this change is required to support .eh_frame case. EhInputSection inherets from InputSectionBase and not from InputSection. So for case when it has relocation section, it should be able to access DependentSections vector. This case is real for Linux kernel. Differential revision: https://reviews.llvm.org/D30084 llvm-svn: 295483
-
Rafael Espindola authored
This is a small difference I noticed to gold and bfd. When given --print-gc-sections, we print sections a linkerscript marks DISCARD. The other linkers don't. llvm-svn: 295467
-
Rafael Espindola authored
This case should be possible to handle, but it is hard: * In order to create program headers correctly, we have to scan the sections in the order they are in the file. * To find that order, we have to "execute" the linker script. * The linker script can contain SIZEOF_HEADERS. So to support this we have to start with a guess of how many headers we need (3), run the linker script and try to create the program headers. If it turns out we need more headers, we run the script again with a larger SIZEOF_HEADERS. Also, running the linker script depends on knowing the size of the sections, so we have to finalize them. But creating the program headers can change the value stored in some sections, so we have to split size finalization and content finalization. Looks like the last part is also needed for range extension thunks, so we might support this at some point. For now just report an error instead of producing broken files. llvm-svn: 295458
-
Rafael Espindola authored
We were only checking when the assignment was inside a section. llvm-svn: 295454
-
Rafael Espindola authored
llvm-svn: 295448
-
Rui Ueyama authored
The previous name caused a little confusion because the function not only returns aliases but a given symbol itself too. llvm-svn: 295408
-
Rui Ueyama authored
llvm-svn: 295388
-
Rafael Espindola authored
Without this we would produce two relocation sections pointing to the same section, which gnu tools reject. This fixes pr31986. The implementation of -r/--emit-reloc is getting fairly complicated. But lets get the test passing before trying to refactor it. llvm-svn: 295385
-
Zachary Turner authored
Some PDBs or object files can contain references to other PDBs where the real type information lives. When this happens, all type indices in the original PDB are meaningless because their records are not there. With this patch we add the ability to pull type info from those secondary PDBs. Differential Revision: https://reviews.llvm.org/D29973 llvm-svn: 295382
-
- Feb 16, 2017
-
-
Rafael Espindola authored
I cannot reproduce the issue locally, but for some reason some bots want to instantiate this from the header. llvm-svn: 295365
-
Rafael Espindola authored
We can do this now that the linker script and the writer agree on which sections should be combined. llvm-svn: 295341
-
George Rimar authored
SHF_LINK_ORDER sections adds special ordering requirements. Such sections references other sections. Previously we would crash if section that other were referenced to was discarded by script. Patch fixes that by discarding all dependent sections in that case. It supports chained dependencies, testcase is provided. Differential revision: https://reviews.llvm.org/D30033 llvm-svn: 295332
-
Rafael Espindola authored
Unfortunately, the common way of writing linker scripts seems to be to get the output of ld.bfd --verbose and edit it a bit. Also unfortunately, the bfd default script contains things like .rela.dyn : { *(... .rela.data ...) } but bfd actually ignores that for -emit-relocs, so we have to do the same. llvm-svn: 295324
-
Rafael Espindola authored
The code to handle the input SHT_REL/SHT_RELA sections was getting confused with the linker generated relocation sections. llvm-svn: 295322
-
George Rimar authored
That fixes a case when section has more than one metadata section. Previously GC would collect one of such sections because we had implementation that stored only last one as dependent. Differential revision: https://reviews.llvm.org/D29981 llvm-svn: 295298
-
Rui Ueyama authored
llvm-svn: 295289
-
Rui Ueyama authored
llvm-svn: 295288
-
Rui Ueyama authored
This patch removes NeedsCopyOrPltAddr and instead add two variables, NeedsCopy and NeedsPltAddr. This uses one more bit in Symbol class, but the actual size doesn't increase because we had unused bits. This should improve code readability. llvm-svn: 295287
-
Rui Ueyama authored
llvm-svn: 295283
-
Rui Ueyama authored
This is slightly inefficient than the previous code, but that is really negligible as this function is usually called at most only a few times. llvm-svn: 295282
-
Rui Ueyama authored
llvm-svn: 295280
-
Rui Ueyama authored
Previously, space in a BSS section for copy relocations are reserved in a special way. We directly manipulated size of the BSS section. r294577 changed the way of doing it. Now, we create an instance of CopyRelSection (which is a synthetic input section) for each copy relocation. This patch removes the remains of the old way and add CopyRelSections to BSS sections using `addSections` function, which is the usual way to add an input section to an output section. llvm-svn: 295278
-
Rafael Espindola authored
In the target dependent code we already always return a int64_t. In the target independent code we carefully use uintX_t, which has the same result given 2 complement rules. This just simplifies the code to use int64_t everywhere. llvm-svn: 295263
-
- Feb 15, 2017
-
-
Ed Schouten authored
For CloudABI I'm only interested in generating non-PIC/PIE executables on armv6 and i686, as PIE introduces larger overhead than on aarch64 and x86_64. Still, I want to be able to instruct the linker to generate a dynamic symbol table if requested. One example use for this is that dynamic symbol tables can be used by programs to print nicely formatted stacktraces, including symbol names. Right now there seems to be some logic in LLD that it only wants to emit dynamic symbol tables when either linking against libraries or when building PIC. Let's extend this to also take --export-dynamic into account. Reviewed by: ruiu Differential Revision: https://reviews.llvm.org/D29982 llvm-svn: 295240
-
Rui Ueyama authored
The linker script lexer is context-sensitive. In the regular context, arithmetic operator characters are regular characters, but in the expression context, they are independent tokens. This afects how the lexer tokenizes "3*4", for example. (This kind of expression is real; the Linux kernel uses it.) This patch defines function `maybeSplitExpr`. This function splits the current token into multiple expression tokens if the lexer is in the expression context. Differential Revision: https://reviews.llvm.org/D29963 llvm-svn: 295225
-
Rui Ueyama authored
llvm-svn: 295222
-