| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
| |
Before this lld was always creating common symbols itself. It worked,
but prevented them from being internalized when possible.
Now it preserves common symbols is the bitcode and they are internalized.
Fixes pr30184.
llvm-svn: 280242
|
|
|
|
| |
llvm-svn: 280237
|
|
|
|
|
|
|
| |
Given that we almost always want to handle it as DefinedRegular, just
use DefinedRegular.
llvm-svn: 280226
|
|
|
|
|
|
| |
We were computing the binding on both the caller and callee.
llvm-svn: 280156
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D24037
llvm-svn: 280144
|
|
|
|
|
|
|
| |
This addresses forgotten review comment for r280067:
"[ELF] - Versionscript: support wildcards for extern "c++" tag."
llvm-svn: 280068
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously for extern keyword only names in quotes (exact match) was supported.
Patch adds support for wildcards, so next scripts can be handled properly:
LIBSAMPLE_1.0 {
global:
extern "C++" {
foo*;
};
};
Differential revision: https://reviews.llvm.org/D23794
llvm-svn: 280067
|
|
|
|
|
|
| |
variable. NFC.
llvm-svn: 280066
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
visibility.
This patch is opposite to D19024, which made this symbols to be hidden by default.
Unfortunately FreeBSD loader wants to see
start_set_modmetadata_set/stop_set_modmetadata_set in the dynamic symbol table.
They were not placed there because had hidden visibility.
Patch makes them to have default visibility again.
Differential revision: https://reviews.llvm.org/D23552
llvm-svn: 279262
|
|
|
|
| |
llvm-svn: 277023
|
|
|
|
|
|
|
|
|
| |
r275711 for "speedng up symbol version handling" was committed
by misunderstanding; the benchmark number was measured with
a debug build. The number with a release build didn't actually change.
This patch removes false optimizations added in that patch.
llvm-svn: 276267
|
|
|
|
|
|
|
| |
Under MSVS 2015 I observed integral constant overflow warning when aggregate initialization was used
to init the bit field. Patch fixes that.
llvm-svn: 276118
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the last patch for --trace-symbol, I introduced a new symbol type
PlaceholderKind and store it to SymVector storage. It made all code
that iterates over SymVector to recognize and skip PlaceholderKind
symbols. I found that that's annoying.
In this patch, I removed PlaceholderKind and stop storing them to SymVector.
Now the information whether a symbol is being watched by --trace-symbol
is stored to the Symtab hash table.
llvm-svn: 275747
|
|
|
|
|
|
|
|
| |
SymVector contains all symbols, so we can iterate either Symtab or SymVector
to visit all symbols. Iterating over SymVector makes the next change for
--trace-symbol possible.
llvm-svn: 275746
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--trace-symbol is a command line option to watch a symbol.
Previosly, we looked up a hash table for a new symbol if the
option is given. Any code that looks up a hash table for each
symbol is expensive because the linker handles a lot of symbols.
In our design, we look up a hash table strictly only once
for a symbol, so --trace-symbol was an exception.
This patch improves efficiency of the option by merging the
hash table into the symbol table.
Instead of looking up a separate hash table with a string,
this patch sets `Traced` flag to symbols specified by --trace-symbol.
So, if you insert a symbol and get a symbol with `Traced` flag on,
you know that you need to print out a log message for the symbol.
This is nearly zero cost.
llvm-svn: 275716
|
|
|
|
|
|
|
| |
Previously, there was no way to get a file name for a DefinedCommon
symbol. This patch adds it.
llvm-svn: 275712
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Versions can be assigned to symbols in two different ways.
One is the usual version scripts, and the other is special
symbol suffix '@'. If a symbol contains '@', the string after
that is considered to specify a version name.
Previously, we look for '@' for all symbols.
Anything that works on every symbol can be expensive because
the linker has to handle a lot of symbols. The search for '@'
was not an exception.
In this patch, I made two optimizations.
The first optimization is to handle '@' only when at least one
version is defined. If no versions are defined, no versions can
be assigned to any symbols, so it's waste of time to search for '@'.
The second optimization is to scan only suffixes of symbol names
instead of entire symbol names. Symbol names can be very long, but
symbol versions are usually short, so scanning entire symbol names
is waste of time, too.
There are some error cases which we no longer be able to detect
with this patch. I don't think it's a major drawback because they
are minor errors. Speed is more important.
This change improves LLD with debug info self-link time from
6.6993 seconds to 6.3426 seconds (or -5.3%).
Differential Revision: https://reviews.llvm.org/D22433
llvm-svn: 275711
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, each subclass of SymbolBody had a pointer to a source
file from which it was created. So, there was no single way to get
a source file for a symbol. We had getSourceFile<ELFT>(), but the
function was a bit inconvenient as it's a template.
This patch makes SymbolBody have a pointer to a source file.
If a symbol is not created from a file, the pointer has a nullptr.
llvm-svn: 275701
|
|
|
|
| |
llvm-svn: 275694
|
|
|
|
| |
llvm-svn: 275693
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BSD toolchain contains a bug:
https://sourceforge.net/p/elftoolchain/tickets/491/
In short demangler works differently, fix was to update the testcase.
It should fix the FreeBSD bot failture:
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/19432/steps/test_lld/logs/stdio
Original commit message was:
[ELF] - Implement extern "c++" version script tag
Patch implements 'extern' version script tag.
Currently only values in quotes(") are supported.
Matching of externs is performed in the same pass as exact match of globals.
Differential revision: http://reviews.llvm.org/D21930
llvm-svn: 275682
|
|
|
|
|
|
| |
SymbolVersions sounds like it had versions for a symbol, so rename it.
llvm-svn: 275674
|
|
|
|
|
|
|
|
|
|
|
| |
The identifier `Version` was used too often in the code to handle
symbol versions. The struct that contains version definitions is
named `Version`. Local variables for version ID are named `Version`.
Local varaible for version string are named `Version`.
This patch give them different names.
llvm-svn: 275673
|
|
|
|
| |
llvm-svn: 275670
|
|
|
|
| |
llvm-svn: 275669
|
|
|
|
|
|
|
|
| |
It broke build bots:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/8204
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/19432
llvm-svn: 275258
|
|
|
|
|
|
|
|
|
|
|
| |
Patch implements 'extern' version script tag.
Currently only values in quotes(") are supported.
Matching of externs is performed in the same pass as exact match of globals.
Differential revision: http://reviews.llvm.org/D21930
llvm-svn: 275257
|
|
|
|
|
|
|
|
|
|
|
| |
That helps to avoid expressions like I + 2 in code
that assigns version number to symbols.
Change was suggested by Rui Ueyama.
Differential revision: http://reviews.llvm.org/D22086
llvm-svn: 275159
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
executable.
When building executable usually version script is absent.
Before this patch error was shown in the case when
symbol name contained version and there was no script to match it.
Instead of error out patch allows
to create new version declaration in this case and use it.
gnu linkers do the same.
That is PR28359.
Differential revision: http://reviews.llvm.org/D21890
llvm-svn: 274828
|
|
|
|
|
|
|
|
|
|
|
|
| |
Symbols.cpp contains functions to handle ELF symbols.
demangle() function is essentially a function to work on a
string rather than on an ELF symbol. So Strings.cpp is a
better place to put that function.
This change also make demangle to demangle symbols unconditionally.
Previously, it demangled symbols only when Config->Demangle is true.
llvm-svn: 274804
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with values matching.
Previously we had incorrect logic here. Imagine we would have the next script:
LIBSAMPLE_1.0
{
global:
a_2;
local:
*;
};
LIBSAMPLE_2.0
{
global:
a*;
};
According to previous logic it would assign version 1 to a_2 and then
would try to reassign it to version 2 because of applying wildcard a*.
And show a warning about that.
Generally Ian Lance Tailor wrote about next rules that should be applied:
(http://www.airs.com/blog/archives/300)
Here are the current rules for gold:
"If there is an exact match for the mangled name, we use it. If there is more than one exact match, we give a warning, and we use the first tag in the script which matches. If a symbol has an exact match as both global and local for the same version tag, we give an error.
Otherwise, we look for an extern C++ or an extern Java exact match. If we find an exact match, we use it. If there is more than one exact match, we give a warning, and we use the first tag in the script which matches. If a symbol has an exact match as both global and local for the same version tag, we give an error.
Otherwise, we look through the wildcard patterns, ignoring “*” patterns. We look through the version tags in reverse order. For each version tag, we look through the global patterns and then the local patterns. We use the first match we find (i.e., the last matching version tag in the file).
Otherwise, we use the “*” pattern if there is one. We give a warning if there are multiple “*” patterns."
Patch makes wildcard matching to be in revered order and to follow after the regular naming matching.
Differential revision: http://reviews.llvm.org/D21894
llvm-svn: 274739
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously BC files were not checked for the same platform etc,
That lead to confusing error "Invalid section header entry size (e_shentsize) in ELF header" when
mixing files for different architectures.
Patch fixes PR28324.
Differential revision: http://reviews.llvm.org/D21832
llvm-svn: 274113
|
|
|
|
|
|
| |
As was suggested by Rafael Espíndola.
llvm-svn: 274111
|
|
|
|
| |
llvm-svn: 274109
|
|
|
|
| |
llvm-svn: 274103
|
|
|
|
|
|
|
|
|
|
| |
We allowed the function to return a vector that contains nullptrs
which is weird. This change makes the function to return only
defined symbols.
Differential Revision: http://reviews.llvm.org/D21828
llvm-svn: 274099
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Example:
VERSION_1.0 {
global: foo*;
local: *; }
now correctly matches all the symbols which name starts with
`foo`.
Differential Revision: http://reviews.llvm.org/D21732
llvm-svn: 274091
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we initialized Config->EKind and Config->EMachine when
we instantiate ELF objects. That was not an ideal location to do that
because the logic was buried too deep inside a concrete logic.
This patch moves the code to the driver so that the initialization
becomes explicit.
Differential Revision: http://reviews.llvm.org/D21784
llvm-svn: 274089
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
t is possible to create new version of symbol instead of depricated one
using combination of version script and asm commands. For example:
__asm__(".symver b_1,b@LIBSAMPLE_1.0");
int b_1() { return 10; }
__asm__(".symver b_2,b@@LIBSAMPLE_2.0");
int b_2() { return 20; }
This code makes b_2() to be default implementation for b().
b_1() is used for compatibility with binaries compiled against
library of older version LIBSAMPLE_1.0.
This patch implements support for above functionality in lld.
Differential revision: http://reviews.llvm.org/D21681
llvm-svn: 274002
|
|
|
|
|
|
|
|
|
|
| |
Option checks for cases where a version script explicitly lists
a symbol, but the symbol is not defined and errors out such
cases if any.
Differential revision: http://reviews.llvm.org/D21745
llvm-svn: 273998
|
|
|
|
|
|
|
|
|
| |
Emitting an error in this case breaks real-world application (e.g. libreoffice).
See http://reviews.llvm.org/D21555 for context.
Differential Revision: http://reviews.llvm.org/D21781
llvm-svn: 273989
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by Shridhar Joshi.
This option provides names of all the link time modules which define and
reference symbols requested by user. This helps to speed up application
development by detecting references causing undefined symbols.
It also helps in detecting symbols being resolved to wrong (unintended)
definitions in case of applications containing multiple definitions for
same symbols with different types, bindings.
Implements PR28226.
llvm-svn: 273536
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For next version script:
VER1{
global:
a;
};
VER2{
global:
a;
};
gold would produce warning like:
"warning: using 'VER1' as version for 'a' which is also named in version 'VER2' in script."
Documentation also says we do not want this duplications (https://people.freebsd.org/~deischen/symver/library_versioning.txt):
"Note that you do not want to duplicate symbols in the map file. The .symver directives are all that is required to add compatibility
symbols into old versions."
This patch restricts such mixing and makes lld to produce error in this case.
Differential revision: http://reviews.llvm.org/D21555
llvm-svn: 273396
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With fix:
-soname flag was not set in testcase. Hash calculated for base def was different on local
and bot machines because filename fos used for calculating.
Initial commit message:
Patch implements basic support of versioned symbols.
There is no wildcards patterns matching except local: *;
There is no support for hierarchies.
There is no support for symbols overrides (@ vs @@ not handled).
This patch allows programs that using simple scripts to link and run.
Differential revision: http://reviews.llvm.org/D21018
llvm-svn: 273152
|
|
|
|
|
|
|
| |
It broke buildbot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast
llvm-svn: 273146
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch implements basic support of versioned symbols.
There is no wildcards patterns matching except local: *;
There is no support for hierarchies.
There is no support for symbols overrides (@ vs @@ not handled).
This patch allows programs that using simple scripts to link and run.
Differential revision: http://reviews.llvm.org/D21018
llvm-svn: 273143
|
|
|
|
|
|
|
|
|
|
| |
Doing that in an anonymous version is a bit silly, but this opens the
way for supporting it in general.
Since we don't support actual versions, for now we just disable the
version script if we detect that it is missing a local.
llvm-svn: 273000
|
|
|
|
|
|
|
| |
We were dropping the CanOmitFromDynSym bit when creating undefined
symbols because of comdat.
llvm-svn: 272812
|
|
|
|
|
|
|
|
|
| |
This should never happen with correct programs, but it is trivial
write a testcase where lld would crash or report duplicated
symbols. We now behave like when an archive is used and include the
file only once.
llvm-svn: 272724
|
|
|
|
| |
llvm-svn: 272719
|