| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 324756
|
|
|
|
|
|
|
|
|
|
|
| |
GNU gold doesn't print out ICF sections for -verbose. It only shows
them for -print-icf-sections. We printed out them for -verbose because
we didn't have -print-icf-sections. Now that we have the option, there's
no reason to print out for -verbose.
Differential Revision: https://reviews.llvm.org/D43100
llvm-svn: 324755
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is for compatiblity with GNU gold. GNU gold tries to resolve
symbols specified by --export-dynamic-symbol. So, if a symbol specified
by --export-dynamic-symbol is in an archive file, lld's result is
currently different from gold's.
Interestingly, that behavior is different for --dynamic-list.
I added a new test to ensure that.
Differential Revision: https://reviews.llvm.org/D43103
llvm-svn: 324752
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a bit more verbose, but it has a few advantages.
The logic on what to do with special sections like .init_array is not
duplicated. Before we would need keep isKnownNonreorderableSection in
sync.
I think with this the call graph based sorting can be implemented by
"just" returning a new order from buildSectionOrder.
llvm-svn: 324744
|
|
|
|
| |
llvm-svn: 324698
|
|
|
|
| |
llvm-svn: 324688
|
|
|
|
| |
llvm-svn: 324684
|
|
|
|
|
|
|
| |
Previously, multiple chunks of --print-icf-sections messages were interleaved
and didn't make sense. This is because forEachClass is multi-threaded.
llvm-svn: 324683
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D43038
llvm-svn: 324656
|
|
|
|
|
|
|
|
| |
resolutions.
Differential Revision: https://reviews.llvm.org/D43051
llvm-svn: 324559
|
|
|
|
|
|
|
|
|
|
|
|
| |
When you omit an argument, most options fall back to their defaults.
For example, --color-diagnostics is a synonym for --color-diagnostics=auto.
We don't have a way to specify the default choice for --build-id, so we
can't describe --build-id (without an argument) in that way.
This patch adds "fast" for the default build-id choice.
Differential Revision: https://reviews.llvm.org/D43032
llvm-svn: 324502
|
|
|
|
|
|
|
|
|
|
|
|
| |
MIPS BFD linker puts _gp_disp symbol into DSO files and assigns zero
version definition index to it. This value means 'unversioned local
symbol' while _gp_disp is a section global symbol. We have to handle
this bug in the LLD because BFD linker is used for building MIPS
toolchain libraries.
Differential revision: https://reviews.llvm.org/D42486
llvm-svn: 324467
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is PR35740 which now crashes
because we remove unused synthetic sections incorrectly.
We can keep input section description and corresponding output
section live even if it must be empty and dead.
This results in a crash because SHF_LINK_ORDER handling code
tries to access first section which is nullptr in this case.
Patch fixes the issue.
Differential revision: https://reviews.llvm.org/D42681
llvm-svn: 324463
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously --defsym=foo2=etext+2 would produce incorrect value
for foo2 because expressions did not work correctly with
reserved symbols, section offset was calculated wrong for them.
Fixes PR35744.
Differential revision: https://reviews.llvm.org/D42911
llvm-svn: 324461
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we ignored -plugin-opt=mcpu=<xxx>
and the only way to set CPU string was to pass
-mllvm -mcpu=<xxx>
Though clang may pass it with use of plugin options:
-plugin-opt=mcpu=x86-64
Since we are trying to be compatible in command line
with gold plugin, seems we should support it too.
Differential revision: https://reviews.llvm.org/D42956
llvm-svn: 324459
|
|
|
|
|
|
|
|
|
| |
objects, it confuses codegen into generating pc-rel relocations for those
symbols, which leads to linker errors.
Differential Revision: https://reviews.llvm.org/D42977
llvm-svn: 324435
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I tested that if I remove "elf" from the message, building a program
that uses libtool prints
checking whether to build shared libraries... no
but with this patch it still prints
checking whether to build shared libraries... yes
llvm-svn: 324428
|
|
|
|
|
|
|
|
|
|
| |
In lld this was the only use of Config->Static where it meant anything
else other than "use .a instead of .so".
If a program turns out to not use any dynamic libraries, we should
produce the same result with and without -static.
llvm-svn: 324421
|
|
|
|
|
|
|
| |
Having the full argv there seems in conflict with the desire to parse
all command line options in the Driver.
llvm-svn: 324418
|
|
|
|
| |
llvm-svn: 324365
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
InitTargetOptionsFromCodeGenFlags/ParseCommandLineOptions for parsing LTO options.".
With fix:
Keep logic that ignores -plugin-opt=mcpu=x86-64 -plugin-opt=thinlto,
add checks for those to testcases.
Original commit message:
[ELF] - Use InitTargetOptionsFromCodeGenFlags/ParseCommandLineOptions for parsing LTO options.
gold plugin uses InitTargetOptionsFromCodeGenFlags +
ParseCommandLineOptions for parsing LTO options.
Patch do the same change for LLD.
Such change helps to avoid parsing/whitelisting LTO
plugin options again on linker side, what can help LLD
to automatically support new -plugin-opt=xxx options
passed.
Differential revision: https://reviews.llvm.org/D42733
llvm-svn: 324340
|
|
|
|
|
|
|
|
|
| |
InitTargetOptionsFromCodeGenFlags/ParseCommandLineOptions for parsing LTO options."
It broke BB:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/8162
llvm-svn: 324332
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
parsing LTO options.
gold plugin uses InitTargetOptionsFromCodeGenFlags +
ParseCommandLineOptions for parsing LTO options.
Patch do the same change for LLD.
Such change helps to avoid parsing/whitelisting LTO
plugin options again on linker side, what can help LLD
to automatically support new -plugin-opt=xxx options
passed.
Differential revision: https://reviews.llvm.org/D42733
llvm-svn: 324322
|
|
|
|
|
|
|
|
| |
GNU gold has these options.
Differential Revision: https://reviews.llvm.org/D42929
llvm-svn: 324300
|
|
|
|
|
|
|
| |
The difference is that WriteAddends also takes IsRela into
consideration.
llvm-svn: 324271
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using Elf_Rela every tool should use the addend in the
relocation.
We have --apply-dynamic-relocs to work around bugs in tools that don't
do that.
The default value of --apply-dynamic-relocs should be false to make
sure these bugs are more easily found in the future.
llvm-svn: 324264
|
|
|
|
|
|
|
| |
Any multi-character option that doesn't start with "o" should be
allowed to start both with "-" and "--".
llvm-svn: 324262
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When resolving dynamic RELA relocations the addend is taken from the
relocation and not the place being relocated. Accordingly lld does not
write the addend field to the place like it would for a REL relocation.
Unfortunately there is some system software, in particlar dynamic loaders
such as Bionic's linker64 that use the value of the place prior to
relocation to find the offset that they have been loaded at. Both gold
and bfd control this behavior with the --[no-]apply-dynamic-relocs option.
This change implements the option and defaults it to true for compatibility
with gold and bfd.
Differential Revision: https://reviews.llvm.org/D42797
llvm-svn: 324221
|
|
|
|
|
|
|
|
|
|
| |
We did not report valid filename for duplicate symbol error when
symbol came from binary input file.
Patch fixes it.
Differential revision: https://reviews.llvm.org/D42635
llvm-svn: 324217
|
|
|
|
| |
llvm-svn: 324155
|
|
|
|
| |
llvm-svn: 324154
|
|
|
|
|
|
|
|
| |
GNU linkers have this option.
Differential Revision: https://reviews.llvm.org/D42858
llvm-svn: 324150
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D42823
llvm-svn: 324146
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D42865
llvm-svn: 324145
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D42859
llvm-svn: 324141
|
|
|
|
|
|
|
|
|
|
|
| |
Initially LLD generates Elf_Rel relocations for O32 ABI and Elf_Rela
relocations for N32 / N64 ABIs. In other words, format of input and
output relocations was always the same. Now LLD generates all output
relocations using Elf_Rel format only. It conforms to ABIs requirement.
The patch suggested by Alexander Richardson.
llvm-svn: 324064
|
|
|
|
|
|
|
|
|
| |
--nopie was a typo. GNU gold doesn't recognize it. It is also
inconsistent with other options that have --foo and --no-foo.
Differential Revision: https://reviews.llvm.org/D42825
llvm-svn: 324043
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D42827
llvm-svn: 324041
|
|
|
|
|
|
|
|
|
| |
In GNU linkers, the last semicolon is optional. We can't link libstdc++
with lld because of that difference.
Differential Revision: https://reviews.llvm.org/D42820
llvm-svn: 324036
|
|
|
|
|
|
|
|
|
| |
This fixes pr36190.
Thanks to James Henderson for the testcase and for pointing out how to
fix this.
llvm-svn: 323993
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently ICF information is output through stderr if the "--verbose"
flag is used. This differs to Gold for example, which uses an explicit
flag to output this to stdout. This commit adds the
"--print-icf-sections" and "--no-print-icf-sections" flags and changes
the output message format for clarity and consistency with
"--print-gc-sections". These messages are still output to stderr if
using the verbose flag. However to avoid intermingled message output to
console, this will not occur when the "--print-icf-sections" flag is
used.
Existing tests have been modified to expect the new message format from
stderr.
Patch by Owen Reynolds.
Differential Revision: https://reviews.llvm.org/D42375
Reviewers: ruiu, rafael
Reviewed by:
llvm-svn: 323976
|
|
|
|
| |
llvm-svn: 323944
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
While trying to make a linker script behave the same way with lld as it did
with bfd, I discovered that lld currently doesn't diagnose overlapping
output sections. I was getting very strange runtime failures which I
tracked down to overlapping sections in the resulting binary. When linking
with ld.bfd overlapping output sections are an error unless
--noinhibit-exec is passed and I believe lld should behave the same way
here to avoid surprising crashes at runtime.
The patch also uncovered an errors in the tests: arm-thumb-interwork-thunk
was creating a binary where .got.plt was placed at an address overlapping
with .got.
Reviewers: ruiu, grimar, rafael
Reviewed By: ruiu
Differential Revision: https://reviews.llvm.org/D41046
llvm-svn: 323856
|
|
|
|
|
|
|
|
|
|
|
|
| |
absolute symbols.
When there is a duplicate absolute symbol, LLD reports <internal>
instead of known object file name currently.
Patch fixes the issue.
Differential revision: https://reviews.llvm.org/D42636
llvm-svn: 323849
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by Nicholas Allegra.
The spec for ELF on PowerPC:
http://refspecs.linux-foundation.org/elf/elfspec_ppc.pdf
says:
"The PowerPC family uses only the Elf32_Rela relocation entries with
explicit addends."
(EM_PPC64 should be covered by Config->Is64 already.)
Differential Revision: https://reviews.llvm.org/D40826
llvm-svn: 323843
|
|
|
|
|
|
|
|
|
|
| |
Previously an empty CPU string was passed to the LTO engine which
resulted in a generic CPU for which certain features like NOPL were
disabled. This fixes that.
Patch by Pratik Bhatu!
llvm-svn: 323801
|
|
|
|
| |
llvm-svn: 323793
|
|
|
|
| |
llvm-svn: 323780
|
|
|
|
|
|
| |
Before this patch orphan sections were not sorted.
llvm-svn: 323779
|
|
|
|
| |
llvm-svn: 323747
|