| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
It was https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L195
and we did not cover it with test.
Patch fixes it.
llvm-svn: 335838
|
|
|
|
|
|
|
|
|
| |
It is the following line:
https://github.com/llvm-mirror/lld/blob/master/ELF/EhFrame.cpp#L120
We did not cover it yet.
llvm-svn: 335833
|
|
|
|
| |
llvm-svn: 335826
|
|
|
|
|
|
| |
It was uncovered by our test cases.
llvm-svn: 335824
|
|
|
|
|
|
| |
It was uncovered by our test cases.
llvm-svn: 335819
|
|
|
|
|
|
|
|
|
| |
We has precompiled object with unsupported FDE version (=2).
It is possible to use llvm-mc instead for this test.
Patch do this change.
llvm-svn: 335818
|
|
|
|
| |
llvm-svn: 335784
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, ICF does not enable threading if we have less than 1024
sections in each equivalence class.
And the following code is uncovered by our test cases:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L404
This patch adds a test case that triggers the mentioned code to execute.
llvm-svn: 335738
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The local dynamic TLS access on PPC64 ELF v2 ABI uses R_PPC64_GOT_DTPREL16*
relocations when a TLS variables falls outside 2 GB of the thread storage
block. This patch adds support for these relocations by adding a new RelExpr
called R_TLSLD_GOT_OFF which emits a got entry for the TLS variable relative
to the dynamic thread pointer using the relocation R_PPC64_DTPREL64. It then
evaluates the R_PPC64_GOT_DTPREL16* relocations as the got offset for the
R_PPC64_DTPREL64 got entries.
Differential Revision: https://reviews.llvm.org/D48484
llvm-svn: 335732
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the target call back relaxTlsGdToLe to support TLS relaxation
from global dynamic to local exec model.
The relaxation performs the following transformation:
addis r3, r2, x@got@tlsgd@ha --> nop
addi r3, r3, x@got@tlsgd@l --> addis r3, r13, x@tprel@ha
bl __tls_get_addr(x@tlsgd) --> nop
nop --> addi r3, r3, x@tprel@l
Differential Revision: https://reviews.llvm.org/D48082
llvm-svn: 335730
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is PR36768.
Linker script OVERLAYs are described in 4.6.9. Overlay Description of the spec:
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Using_ld_the_GNU_Linker/sections.html
They are used to allow output sections which have different LMAs but the same VAs
and used for embedded programming.
Currently, LLD restricts overlapping of sections and that seems to be the most desired
behaviour for defaults. My thoughts about possible approaches for PR36768 are on the bug page,
this patch implements OVERLAY keyword and allows VAs overlapping for sections that within the overlay.
Differential revision: https://reviews.llvm.org/D44780
llvm-svn: 335714
|
|
|
|
| |
llvm-svn: 335713
|
|
|
|
|
|
|
|
|
| |
This is a less clever version of https://reviews.llvm.org/D48433.
This is a dumb version but I think I prefer this for its simplicity.
Differential Revision: https://reviews.llvm.org/D48621
llvm-svn: 335712
|
|
|
|
| |
llvm-svn: 335676
|
|
|
|
|
|
|
|
|
|
|
|
| |
This generalizes the old heuristic placing SHT_DYNSYM SHT_DYNSTR first in the readonly SHF_ALLOC segment.
Reviewers: espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D48406
llvm-svn: 335674
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch adds support for relaxing the general-dynamic tls sequence to
initial-exec.
the relaxation performs the following transformation:
addis r3, r2, x@got@tlsgd@ha --> addis r3, r2, x@got@tprel@ha
addi r3, r3, x@got@tlsgd@l --> ld r3, x@got@tprel@l(r3)
bl __tls_get_addr(x@tlsgd) --> nop
nop --> add r3, r3, r13
and instead of emitting a DTPMOD64/DTPREL64 pair for x, we emit a single
R_PPC64_TPREL64.
Differential Revision: https://reviews.llvm.org/D48090
llvm-svn: 335651
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Currently when --no-rosegment is specified or a linker script with SECTIONS command is used,
.rodata (A) .text (AX) are assigned the same rank and .rodata may be placed after .text .
This increases the gap between .text and .bss and can cause pc-relative relocation overflow (e.g. gcc crtbegin.o crtbegin.S have R_X86_64_PC32 relocation from .text to .bss).
This patch makes SingleRoRx affect only segment layout, not section layout. As a consequence, .rodata will be placed before .text regardless of SingleRoRx.
Reviewers: espindola, ruiu, grimar, echristo, javed.absar
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D48405
llvm-svn: 335627
|
|
|
|
| |
llvm-svn: 335625
|
|
|
|
| |
llvm-svn: 335499
|
|
|
|
|
|
|
|
|
| |
* Move `REQUIRES:` line to the top
* llvm-mc ... -o %t -> llvm-mc ... -o %t.o
* Don't check "TEXT" "DATA" columns (they are bfd-style names that do
not fit into llvm well) in llvm-objdump output
llvm-svn: 335498
|
|
|
|
|
|
| |
Style change for consistency. NFC
llvm-svn: 335494
|
|
|
|
|
|
|
|
|
|
|
|
| |
ICF is able to merge sections which relocations referring regular input sections
or mergeable sections, so it handles InputSection and MergeInputSection cases.
The following "return false" line which is executed in case of another type
of the sections is uncovered by our test cases:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L285
Patch fixes code coverage for this place.
llvm-svn: 335482
|
|
|
|
| |
llvm-svn: 335479
|
|
|
|
|
|
|
|
|
|
| |
Check that ICF does not merge sections which relocations
have equal addends, but different target values.
This covers the following line, which was uncovered:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L278
llvm-svn: 335477
|
|
|
|
|
|
|
|
|
|
|
| |
This test case check that ICF does not merge 2 sections which relocations
efer to symbols that live in sections of the different types
(regular input section and mergeable input sections in this case).
It covers the following line of code, which was uncovered previously:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L271
llvm-svn: 335475
|
|
|
|
|
|
|
|
|
|
|
| |
symbols of the different types.
This test case covers the following line of code:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L261
Previously it was uncovered.
llvm-svn: 335453
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: jyknight, Bigcheese, espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D48473
llvm-svn: 335404
|
|
|
|
|
|
|
|
|
|
|
| |
addend.
This is to test the following `return false` line which
was uncovered by our tests earlier:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L255
llvm-svn: 335357
|
|
|
|
|
|
|
|
|
|
| |
This caused a lot of issues on the WebAssembly waterfall.
In particular, until with the signature of `main`. We
probably want a better solution for main before we re-land.
Reverts rL335192
llvm-svn: 335355
|
|
|
|
|
|
|
|
|
| |
--verbose is not used to report ICF sections since r324755,
--print-icf-sections is used instead.
These tests were at fact disabled since that time.
llvm-svn: 335354
|
|
|
|
|
|
|
|
|
|
| |
These test cases covers the following condition:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L243
It was uncovered by our tests. I was able to delete the whole `if`
and no test failed.
llvm-svn: 335351
|
|
|
|
|
|
|
|
|
| |
Previously we were also marking undefined symbols (i.e. imports)
as live.
Differential Revision: https://reviews.llvm.org/D48299
llvm-svn: 335243
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During symbol resolution, emit warnings for function signature
mismatches. During GC, if any mismatched symbol is marked as live
then generate an error.
This means that we only error out if the mismatch is written to the
final output. i.e. if we would generate an invalid wasm file.
Differential Revision: https://reviews.llvm.org/D48394
llvm-svn: 335192
|
|
|
|
|
|
|
|
|
|
|
| |
Update load-undefined.test such that it doesn't rely on
ret32 and ret64 having default visibility.
Split out from: https://reviews.llvm.org/D48394
Differential Revision: https://reviews.llvm.org/D48403
llvm-svn: 335187
|
|
|
|
|
|
|
|
|
|
| |
We don't start our error messages with capital letters.
Split out from https://reviews.llvm.org/D48394
Differential Revision: https://reviews.llvm.org/D48400
llvm-svn: 335186
|
|
|
|
|
|
|
|
|
| |
While building a Global Offset Table try to fill the primary GOT as much
as possible because the primary GOT can be accessed in the most
effective way. If it is not possible, try to fill the last GOT in the
multi-GOT list, and finally create a new GOT if both attempts failed.
llvm-svn: 335140
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
glibc uses this option to link libpthread.so
glibc/nptl/Makefile:
LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
Reviewers: ruiu, echristo, espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D48329
llvm-svn: 335090
|
|
|
|
|
|
|
|
|
| |
microMIPS 64-bit is unsupported by LLVM starting from r335057. But such
code can be generated by GCC. Mark failed test cases as XFAIL while
decide to drop microMIPS 64-bit support from LLD too or use binary
inputs for the test.
llvm-svn: 335059
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: For --wrap foo --wrap foo, bfd/gold wrap the symbol only once but LLD would rotate it twice.
Reviewers: ruiu, espindola
Subscribers: emaste, arichardson, mgrang, llvm-commits
Differential Revision: https://reviews.llvm.org/D48298
llvm-svn: 334991
|
|
|
|
|
|
|
|
|
| |
This is a follow up requested during post commit review for
"[lld] r333880 - [ELF] - Also use DW_AT_linkage_name when gathering information about variables for error messages."
It removes checking of the input objects since it is really excessive.
llvm-svn: 334946
|
|
|
|
|
|
|
|
| |
requirement. NFC
Fix for PR37785.
llvm-svn: 334851
|
|
|
|
| |
llvm-svn: 334762
|
|
|
|
|
|
| |
Fixes https://crbug.com/852882
llvm-svn: 334761
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
R_X86_64_GOTOFF64: S + A - GOT
R_X86_64_GOTPC{32,64}: GOT + A - P (R_GOTONLY_PC_FROM_END)
R_X86_64_GOTOFF64 should use R_GOTREL_FROM_END so that in conjunction with
R_X86_64_GOTPC{32,64}, the `GOT` term is neutralized. This also matches
the handling of R_386_GOTOFF (S + A - GOT).
Reviewers: ruiu, espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D48095
llvm-svn: 334672
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Any invocation of `clang -fuse-ld=lld` that results in a link command
on a macOS host currently fails, because the Darwin lld driver does not
recognize the `-lto_library` option that Clang passes it. Fix the error
by having the Darwin driver ignore the option.
The Clang driver's macOS toolchain is written such that it will always
pass the `-lto_library` option to the linker invocation on a macOS host.
And although the DarwinLdDriver is written to ignore any unknown arguments,
because `-lto_library` begins with `-l`, the DarwinLdDriver interprets it
as a library search command, for a library named "to_library". When the
DarwinLdDriver is unable to find a library specified via `-l`, it exits
with a hard error. This causes any invocation of `clang -fuse-ld=lld`
that results in a link command on a macOS host to fail with an error.
To fix the issue, I considered two alternatives:
1. Modify the Clang Darwin toolchain to only pass `-lto_library` if lld
is *not* being used. lld doesn't support LTO on Darwin anyway, so it
can't use the option. However, I opted against this because, if and
when lld *does* support LTO on Darwin, I'll have to make another
commit to Clang in order to get it to pass the option to lld again.
2. Modify the Darwin lld driver to ignore the `-lto_library` option.
Just in case users may take this to mean LTO is supported, I also
added a warning. If and when lld supports LTO on Darwin, the same
commit that adds support for this option can remove the warning.
Option (2) seemed better to me, and is the rationale behind this commit.
Test Plan: check-lld
Reviewers: ruiu, smeenai, pcc
Reviewed By: smeenai
Subscribers: JDevlieghere, pcc, mehdi_amini, inglorion, steven_wu, llvm-commits
Differential Revision: https://reviews.llvm.org/D47994
llvm-svn: 334641
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D47791
llvm-svn: 334637
|
|
|
|
|
|
|
|
|
|
| |
`lld-link foo.lib /wholearchive:foo.lib` should work the same way as
`lld-link /wholearchive:foo.lib foo.lib`. Previously, /wholearchive in
the former case was ignored.
Differential Revision: https://reviews.llvm.org/D47565
llvm-svn: 334552
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running with linker GC (`-opt:ref`), defined imported symbols that
are referenced but then dropped by GC end up with their `Location`
member being nullptr, which means `getChunk()` returns nullptr for them
and attempting to call `getChunk()->getOutputSection()` causes a crash
from the nullptr dereference. Check for `getChunk()` being nullptr and
bail out early to avoid the crash.
Differential Revision: https://reviews.llvm.org/D48092
llvm-svn: 334548
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
R_X86_64_GOTOFF64 is a relocation type to set to a distance betwween
a symbol and the beginning of the .got section. Previously, we always
created a dynamic relocation for the relocation type even though it
can be resolved at link-time.
Creating a dynamic relocation for R_X86_64_GOTOFF64 caused link failure
for some programs that do have a relocation of the type in a .text
section, as text relocations are prohibited in most configurations.
Differential Revision: https://reviews.llvm.org/D48058
llvm-svn: 334534
|
|
|
|
| |
llvm-svn: 334533
|