| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the relocations needed support the local-exec TLS model:
R_PPC64_TPREL16
R_PPC64_TPREL16_HA
R_PPC64_TPREL16_LO
R_PPC64_TPREL16_HI
R_PPC64_TPREL16_DS
R_PPC64_TPREL16_LO_DS
R_PPC64_TPREL16_HIGHER
R_PPC64_TPREL16_HIGHERA
R_PPC64_TPREL16_HIGHEST
R_PPC64_TPREL16_HIGHESTA
Differential Revision: https://reviews.llvm.org/D47598
llvm-svn: 334304
|
|
|
|
| |
llvm-svn: 334250
|
|
|
|
|
|
| |
Makes this consistent with other ModuleSummaryIndex constructor calls.
llvm-svn: 334141
|
|
|
|
|
|
|
|
|
|
| |
The original computation for shared object symbol alignment is wrong when
st_value equals 0. It is very unusual for dso symbols to have st_value equal 0.
But when it happens, it causes obscure run time bugs.
Differential Revision: https://reviews.llvm.org/D47602
llvm-svn: 334135
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, "-m is missing" error message is shown if you pass a
nonexistent file or don't pass any file at all to lld, as shown below:
$ ld.lld nonexistent.o
ld.lld: error: cannot open nonexistent.o: No such file or directory
ld.lld: error: target emulation unknown: -m or at least one .o file required
This patch eliminates the second error message because it's not related
and even inaccurate (you passed a .o file though it didn't exist).
llvm-svn: 334024
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
variables for error messages.
Currently, when LLD do a lookup for variables location, it uses DW_AT_name attribute.
That is not always enough.
Imagine code:
namespace A {
int bar = 0;
}
namespace Z {
int bar = 1;
}
int hoho;
In this case there are 3 variables and their debug attributes are following:
A::bar has: DW_AT_name [DW_FORM_string] ("bar") DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x00000006] = "_ZN1A3barE")
Z::bar has: DW_AT_name [DW_FORM_string] ("bar") DW_AT_linkage_name [DW_FORM_strp] ( .debug_str[0x0000003f] = "_ZN1Z3barE")
hoho has: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000004a] = "hoho") and has NO DW_AT_linkage_name attribute. Because it would be
the same as DW_AT_name and DWARF producers avoids emiting excessive data.
Hence LLD should also use DW_AT_linkage_name when it is available.
(currently, LLD fails to report location correctly because thinks that A::bar and Z::bar are the same things)
Differential revision: https://reviews.llvm.org/D47373
llvm-svn: 333880
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clang passes --plugin /path/to/LLVMgold.so to the linker when -flto is
passed. After r333607 we only ignore --plugin as a joined argument,
which means that the following argument (/path/to/LLVMgold.so) is
interpreted as an input file. This means that either every LTO'd
program ends up being linked with the gold plugin or we error out
if the plugin does not exist. The fix is to use Eq to ignore both
--plugin=foo and --plugin foo as before.
Differential Revision: https://reviews.llvm.org/D47657
llvm-svn: 333793
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D47656
llvm-svn: 333792
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the relocations needed support the initial-exec TLS model:
R_PPC64_GOT_TPREL16_HA
R_PPC64_GOT_TPREL16_LO_DS
R_PPC64_GOT_TPREL16_DS
R_PPC64_GOT_TPREL16_HI
R_PPC64_TLS
Differential Revision: https://reviews.llvm.org/D47455
llvm-svn: 333769
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since aliases don't actually need name, I removed it from Options.td
to keep the definitions concise.
Before:
-( Ignored for compatibility with GNU unless you pass --warn-backrefs
-) Ignored for compatibility with GNU unless you pass --warn-backrefs
--allow-multiple-definition Allow multiple definitions
--apply-dynamic-relocs Apply dynamic relocations to place
--as-needed Only set DT_NEEDED for shared libraries if used
--auxiliary=<value> Set DT_AUXILIARY field to the specified name
--Bdynamic Link against shared libraries
--Bshareable Build a shared object
...
After:
-( Alias for --start-group
-) Alias for --end-group
--allow-multiple-definition Allow multiple definitions
--apply-dynamic-relocs Apply dynamic relocations to place
--as-needed Only set DT_NEEDED for shared libraries if used
--auxiliary=<value> Set DT_AUXILIARY field to the specified name
--Bdynamic Link against shared libraries (default)
--Bshareable Alias for --shared
...
Differential Revision: https://reviews.llvm.org/D47588
llvm-svn: 333694
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
After r333596, rpath-link no longer consumes the following argument, and
the path argument left by it confuses LLD.
Reviewers: espindola, ruiu
Reviewed By: ruiu
Subscribers: ruiu, emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D47591
llvm-svn: 333686
|
|
|
|
|
|
|
|
|
| |
Add support for the R_PPC64_GOT_TLSLD16 relocations used to build the address of
the tls_index struct used in local-dynamic tls.
Differential Revision: https://reviews.llvm.org/D47538
llvm-svn: 333681
|
|
|
|
|
|
|
|
|
| |
getRelocTargetVA for R_TLSGD and R_TLSLD RelExprs calculate an offset from the
end of the got, so adjust the names to reflect this.
Differential Revision: https://reviews.llvm.org/D47379
llvm-svn: 333674
|
|
|
|
|
|
| |
This change makes it impossible to use these options in code.
llvm-svn: 333655
|
|
|
|
| |
llvm-svn: 333654
|
|
|
|
|
|
|
| |
Broken buildbot log:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/30855/steps/build/logs/stdio
llvm-svn: 333648
|
|
|
|
| |
llvm-svn: 333647
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--push-state implemented in this patch saves the states of --as-needed,
--whole-archive and --static. It saves less number of flags than GNU linkers.
Since even GNU linkers save different flags, no one seems to care about the
details. In this patch, I tried to save the minimal number of flags to not
complicate the implementation and the siutation.
I'm not personally happy about adding the --{push,pop}-state flags though.
That options seem too hacky to me. However, gcc started using the options
since GCC 8 when GNU ld is available at the build time. Therefore, lld
is no longer a drop-in replacmenet for GNU linker for that machine
without supporting the flags.
Fixes https://bugs.llvm.org/show_bug.cgi?id=34567
Differential Revision: https://reviews.llvm.org/D47542
llvm-svn: 333646
|
|
|
|
|
|
|
|
| |
This improves the help message shown for `ld.lld --help`.
Differential Revision: https://reviews.llvm.org/D47562
llvm-svn: 333607
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we printed out two lines of help messages for `--foo bar`
and `--foo=bar` like this:
--soname=<value> Set DT_SONAME
--soname <value> Set DT_SONAME
--sort-section=<value> Specifies sections sorting rule when linkerscript is used
--sort-section <value> Specifies sections sorting rule when linkerscript is used
This change eliminates duplicate lines that doesn't contain `=` for such
options like this.
--soname=<value> Set DT_SONAME
--sort-section=<value> Specifies sections sorting rule when linkerscript is used
Differential Revision: https://reviews.llvm.org/D47558
llvm-svn: 333596
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D47512
llvm-svn: 333505
|
|
|
|
|
|
|
|
|
| |
Adds handling of all the relocation types for general-dynamic thread local
storage.
Differential Revision: https://reviews.llvm.org/D47325
llvm-svn: 333420
|
|
|
|
|
|
| |
Previously, we wrote only the least significant 32 bits.
llvm-svn: 333313
|
|
|
|
| |
llvm-svn: 333312
|
|
|
|
| |
llvm-svn: 333294
|
|
|
|
|
|
|
| |
Set the IRelative relocation type and extend the related test to verify.
Differential Revision: https://reviews.llvm.org/D46877
llvm-svn: 333203
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PPC64 maintains a compiler managed got in the .toc section. When accessing a
global variable through got-indirect access, a .toc entry is created for the
variable. The relocation for the got-indirect access will refer to the .toc
section rather than the symbol that is actually accessed. The .toc entry
contains the address of the global variable. We evaluate the offset from
r2 (which is the TOC base) to the address of the toc entry for the global
variable. Currently, the .toc is not near the .got. This causes errors because
the offset from r2 to the toc section is too large. The linker needs to add
all the .toc input sections to the .got output section, merging the compiler
managed got with the linker got. This ensures that the offsets from the TOC
base to the toc entries are not too large.
This patch puts the .toc section right after the .got section.
Differential Revision: https://reviews.llvm.org/D45833
llvm-svn: 333199
|
|
|
|
|
|
| |
This reverts commit cc6f052261096dc9d4c9d3123e37b023c3e171df.
llvm-svn: 333099
|
|
|
|
|
|
|
|
|
|
| |
A user program may enumerate sections named with a C identifier using
__start_* and __stop_* symbols. We cannot ICF any such sections because
that could change program semantics.
Differential Revision: https://reviews.llvm.org/D47242
llvm-svn: 333054
|
|
|
|
|
|
|
|
|
|
| |
Note that this doesn't do the right thing in the case where there is
a linker script. We probably need to move output section assignment
before ICF to get the correct behaviour here.
Differential Revision: https://reviews.llvm.org/D47241
llvm-svn: 333052
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D47234
llvm-svn: 333040
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Move some common code into Common/rrorHandler.cpp and
Common/Strings.h.
- Don't use `fatal` when incompatible bitcode files are
encountered.
- Rename NameRef variable to just Name
See D47162
Differential Revision: https://reviews.llvm.org/D47206
llvm-svn: 333021
|
|
|
|
| |
llvm-svn: 332995
|
|
|
|
|
|
| |
We can directly assign to a std::pair without std::tie.
llvm-svn: 332994
|
|
|
|
| |
llvm-svn: 332952
|
|
|
|
|
|
|
|
|
|
| |
Previously, we had a loop to iterate over options starting with
`--plugin-opt=` and parse them by hand. But we can make OptTable
do that job for us.
Differential Revision: https://reviews.llvm.org/D47167
llvm-svn: 332935
|
|
|
|
| |
llvm-svn: 332859
|
|
|
|
|
|
|
|
|
|
| |
See r332845.
Reviewed by: grimar
Differential Revision: https://reviews.llvm.org/D46832
llvm-svn: 332846
|
|
|
|
|
|
|
|
|
| |
_init_array_start/end are placed at 0 if no ".init_array" presents,
this causes .text relocation against them become more prone to overflow.
This CL sets ".init_array" address to that of ".text" to mitigate the situation.
Review: https://reviews.llvm.org/D46200
llvm-svn: 332688
|
|
|
|
| |
llvm-svn: 332658
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by Mark Kettenis.
Make ALIGN work in linker scripts used with the -r option. This works in
GNU ld (ld.bfd) and is used to generate the "random gap" object for
linking the OpenBSD kernel.
Differential Revision: https://reviews.llvm.org/D46839
llvm-svn: 332656
|
|
|
|
| |
llvm-svn: 332643
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sections.
Currently, LLD marks all non-allocatable sections except SHF_REL[A] as Live
when doing GC.
This can be a reason of the crash when SHF_LINK_ORDER sections
are involved, because their parents can be dead.
We should do GC for them correctly. The patch implements it.
Differential revision: https://reviews.llvm.org/D46880
llvm-svn: 332589
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: sfertile, espindola
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D46904
llvm-svn: 332572
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D46608
llvm-svn: 332527
|
|
|
|
| |
llvm-svn: 332408
|
|
|
|
|
|
|
|
|
|
|
| |
This CL places .dynsym and .dynstr at the beginning of SHF_ALLOC
sections. We do this to mitigate the possibility that huge .dynsym and
.dynstr sections placed between ro-data and text sections cause
relocation overflow.
Differential Revision: https://reviews.llvm.org/D45788
llvm-svn: 332374
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The --keep-unique <symbol> option is taken from gold. The intention is that
<symbol> will be prevented from being folded by ICF. Although not
specifically mentioned in the documentation <symbol> only matches
global symbols, with a warning if the symbol is not found.
The implementation finds the Section defining <symbol> and removes it from
the set of sections considered for ICF.
Differential Revision: https://reviews.llvm.org/D46755
llvm-svn: 332332
|
|
|
|
|
|
|
|
|
| |
The relocation R_PPC64_REL64 should return R_PC for getRelExpr since it
computes S + A - P.
Differential Revision: https://reviews.llvm.org/D46766
llvm-svn: 332259
|
|
|
|
|
|
|
|
|
| |
The relocation R_PPC64_REL32 should return R_PC for getRelExpr since it
computes S + A - P.
Differential Revision: https://reviews.llvm.org/D46586
llvm-svn: 332252
|