| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D40571
llvm-svn: 319221
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes a fix to mark copy reloc aliases as used.
Original message:
[ELF] Do not keep symbols if they referenced only from discarded sections.
This patch also ensures that in case of "--as-needed" is used,
DT_NEEDED entries are not created if they are required only by
these eliminated symbols.
llvm-svn: 319215
|
|
|
|
|
|
|
|
|
|
|
| |
discarded sections."
and r319051, "Add a missing test."
r319008 broke the LTO bots;
r319051 depends on changes in r319008.
llvm-svn: 319154
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D40530
llvm-svn: 319138
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we mark every shared symbol as STB_WEAK.
That is a hack to make it easy to decide when a .so is needed or not
because of a reference to a given symbol.
That hack leaks when we create copy relocations as shown by the update
to relocation-copy-alias.s.
This patch stores the original binding when we first read a shared
symbol. We still have to update the binding to weak if we see a weak
undef, but I find the logic easier to read where it is now.
llvm-svn: 319127
|
|
|
|
|
|
|
|
|
|
|
| |
This is also consistent with SymVector that exists in COFF port
and soon to be added to the wasm port.
Split off as part of https://reviews.llvm.org/D40371
Differential Revision: https://reviews.llvm.org/D40525
llvm-svn: 319113
|
|
|
|
|
|
|
|
|
|
| |
This patch also ensures that in case of "--as-needed" is used,
DT_NEEDED entries are not created if they are required only by
these eliminated symbols.
Differential Revision: https://reviews.llvm.org/D38790
llvm-svn: 319008
|
|
|
|
|
|
| |
This is a reduction of a patch by Rui Ueyama.
llvm-svn: 318852
|
|
|
|
|
|
|
| |
Since we always have Binding in the current symbol design IsLocal is
redundant.
llvm-svn: 318497
|
|
|
|
|
|
| |
copyFrom doesn't copy the Binding, so this was a nop.
llvm-svn: 317965
|
|
|
|
|
|
| |
This fixes a regression from r317426.
llvm-svn: 317956
|
|
|
|
|
|
|
|
|
| |
The Traced flag is unnecessary because we only need to set the index
to -1 to mark a symbol for tracing.
Differential Revision: https://reviews.llvm.org/D39672
llvm-svn: 317450
|
|
|
|
|
|
| |
This function is now equivalent to isDefined().
llvm-svn: 317449
|
|
|
|
|
|
|
|
|
| |
Now that DefinedRegular is the only remaining derived class of
Defined, we can merge the two classes.
Differential Revision: https://reviews.llvm.org/D39667
llvm-svn: 317448
|
|
|
|
|
|
|
|
|
| |
Common symbols are now represented with a DefinedRegular that points
to a BssSection, even during symbol resolution.
Differential Revision: https://reviews.llvm.org/D39666
llvm-svn: 317447
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r317396 changed the way how we handle the -defsym option. The option is
now handled using the infrastructure for the linker script.
We used to handle both -defsym and -wrap using the same set of functions
in the symbol table. Now, we don't need to do that.
This patch rewrites the functions so that they become more straightforward.
The new functions directly handle -wrap rather than abstract it.
llvm-svn: 317426
|
|
|
|
| |
llvm-svn: 317425
|
|
|
|
| |
llvm-svn: 317383
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we have only SymbolBody as the symbol class. So, "SymbolBody"
is a bit strange name now. This is a mechanical change generated by
perl -i -pe s/SymbolBody/Symbol/g $(git grep -l SymbolBody lld/ELF lld/COFF)
nd clang-format-diff.
Differential Revision: https://reviews.llvm.org/D39459
llvm-svn: 317370
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is PR34826.
Currently LLD is unable to report line number when reporting
duplicate declaration of some variable.
That happens because for extracting line information we always use
.debug_line section content which describes mapping from machine
instructions to source file locations, what does not help for
variables as does not describe them.
In this patch I am taking the approproate information about
variables locations from the .debug_info section.
Differential revision: https://reviews.llvm.org/D38721
llvm-svn: 317080
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SymbolBody and Symbol were separated classes due to a historical reason.
Symbol used to be a pointer to a SymbolBody, and the relationship
between Symbol and SymbolBody was n:1.
r2681780 changed that. Since that patch, SymbolBody and Symbol are
allocated next to each other to improve memory locality, and they have
1:1 relationship now. So, the separation of Symbol and SymbolBody no
longer makes sense.
This patch merges them into one class. In order to avoid updating too
many places, I chose SymbolBody as a unified name. I'll rename it Symbol
in a follow-up patch.
Differential Revision: https://reviews.llvm.org/D39406
llvm-svn: 317006
|
|
|
|
| |
llvm-svn: 316862
|
|
|
|
|
|
|
| |
Finding aliases for shared symbols doesn't need st_shndx because
we can just compare st_value.
llvm-svn: 316848
|
|
|
|
|
|
|
| |
This change allows us to use less templates for Shared symbol and
the functions that deals with shared symbols.
llvm-svn: 316841
|
|
|
|
|
|
|
|
|
|
|
|
| |
DSO is short for dynamic shared object, so the function name was a
little confusing because it sounded like it didn't work when we were
a creating statically-linked executable or something.
What we mean by "DSO" here is the current output file that we are
creating. Thus the new name. Alternatively, we could call it the current
ELF module, but "module" is a overloaded word, so I avoided that.
llvm-svn: 316809
|
|
|
|
| |
llvm-svn: 316732
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The COFF linker and the ELF linker have long had similar but separate
Error.h and Error.cpp files to implement error handling. This change
introduces new error handling code in Common/ErrorHandler.h, changes the
COFF and ELF linkers to use it, and removes the old, separate
implementations.
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits
Differential Revision: https://reviews.llvm.org/D39259
llvm-svn: 316624
|
|
|
|
| |
llvm-svn: 316455
|
|
|
|
|
|
|
|
| |
It causes MSVC 2015 to emit "C4307: '-': integral constant overflow" warning
Differential Revision: https://reviews.llvm.org/D38955
llvm-svn: 315926
|
|
|
|
| |
llvm-svn: 315881
|
|
|
|
| |
llvm-svn: 315877
|
|
|
|
|
|
|
| |
This matches the behavior of gold and bfd. It also matches lld's own
behavior when the shared symbol is seen first
llvm-svn: 315766
|
|
|
|
| |
llvm-svn: 315734
|
|
|
|
|
|
|
| |
I don't think there is an observable difference. We now just avoid
doing silly things like setting versions in lazy symbols.
llvm-svn: 315650
|
|
|
|
|
|
|
| |
I will try to make this API a bit less error prone, but for now just
get another test passing.
llvm-svn: 315645
|
|
|
|
| |
llvm-svn: 315141
|
|
|
|
|
|
|
|
|
| |
list." which was reverted in r315116.
I hadn't synced past the change that changed the default hash style
to --hash-style=both, so my test had the symbols in the wrong order.
llvm-svn: 315119
|
|
|
|
|
|
|
| |
For some reason the symbols get emitted in the wrong order on one of the
buildbots: http://bb9.pgr.jp/#builders/15/builds/180
llvm-svn: 315116
|
|
|
|
|
|
|
|
|
|
|
|
| |
Dynamic lists in an executable are additive, not restrictive, so we
must continue to export preempted symbols even with a dynamic list.
This fixes sanitizer interception of libc symbols (and should also fix
symbol preemption by users of sanitizers).
Differential Revision: https://reviews.llvm.org/D38647
llvm-svn: 315114
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this patch we would copy foo into real_foo and wrap_foo into
foo. The net result is that __wrap_foo shows up twice in the symbol
table.
With this patch we:
* save a copy of __real_foo before copying foo.
* drop one of the __wrap_foo from the symbol table.
* if __real_foo was not undefined, add a *new* symbol with that content to
the symbol table.
The net result is that
Anything using foo now uses __wrap_foo
Anything using __real_foo now uses foo.
Anything using __wrap_foo still does.
And the symbol table has foo, __wrap_foo and __real_foo (if defined).
Which I think is the desired behavior.
llvm-svn: 315097
|
|
|
|
|
|
|
| |
Since VisibleToRegularObj is weaker than LinkerRedefined, this should
have no functionality change.
llvm-svn: 314954
|
|
|
|
| |
llvm-svn: 314841
|
|
|
|
|
|
|
| |
Without this patch, lld emits "error: undefined symbol: _start"
if it encountered only weak references to that symbol.
llvm-svn: 314790
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D38348
llvm-svn: 314789
|
|
|
|
| |
llvm-svn: 314591
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SymbolTable::insert() is a hot path function. When linking a clang debug
build, the function is called 3.7 million times. The total amount of "Name"
string contents is 300 MiB. That means this `Name.find("@@")` scans almost
300 MiB of data. That's far from negligible.
StringRef::find(StringRef) uses a sophisticated algorithm, but the
function is slow for a short needle. This patch replaces it with
StringRef::find(char).
This patch alone speeds up a clang debug build link time by 0.5 seconds
from 8.2s to 7.7s. That's 6% speed up. It seems too good for this tiny
change, but looks like it's real.
llvm-svn: 314192
|
|
|
|
|
|
| |
This patch is to improve code readability.
llvm-svn: 314089
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to keep track of symbol renaming, we used to have
Config->SymbolRenaming, and whether a symbol is in the map or not
affects its symbol attribute (i.e. "LinkeRedefined" bit).
This patch adds "CanInline" bit to Symbol to aggreagate symbol
information in one place and removed the member from Config since
no one except SymbolTable now uses the table.
llvm-svn: 314088
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes lot of static Instances arrays from different input file
classes and introduces global arrays for access instead. Similar to arrays we
have for InputSections/OutputSectionCommands.
It allows to iterate over input files in a non-templated code.
Differential revision: https://reviews.llvm.org/D35987
llvm-svn: 313619
|
|
|
|
| |
llvm-svn: 313184
|