llvm-project/lld
George Rimar f73a25812f [ELF] - Fixed incorrect logic of version assignments when mixing wildcards 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
2016-07-07 07:45:27 +00:00
..
COFF Fix logic error in check() function. 2016-06-30 00:32:24 +00:00
ELF [ELF] - Fixed incorrect logic of version assignments when mixing wildcards with values matching. 2016-07-07 07:45:27 +00:00
cmake/modules
docs Update numbers. 2016-06-13 22:48:36 +00:00
include/lld [lld][MachO] Remove SimpleFile::definedAtoms(). 2016-06-28 18:42:33 +00:00
lib Matching change for lld for the llvm change of Archive::create() from ErrorOr<...> to Expected<...> in r274160. 2016-06-29 20:36:11 +00:00
test [ELF] - Fixed incorrect logic of version assignments when mixing wildcards with values matching. 2016-07-07 07:45:27 +00:00
tools/lld Update to match LLVM r272232. 2016-06-09 00:54:16 +00:00
unittests Fix Clang-tidy misc-unused-using-decls and Include What You Use warnings. 2016-04-21 17:14:10 +00:00
.arcconfig
.clang-format Remove redundant "Standard: Cpp11" tag. The LLVM style has used the 2014-07-04 12:08:03 +00:00
.gitignore Update .gitignore to ignore hidden MacOSX Finder droppings 2014-07-16 21:01:17 +00:00
CMakeLists.txt Inline a trivial CMakeLists.txt. 2016-03-03 01:56:23 +00:00
CODE_OWNERS.TXT Add initial CODE_OWNERS.TXT file 2015-07-25 00:44:37 +00:00
LICENSE.TXT Update copyright year to 2016. 2016-03-30 22:40:59 +00:00
README.md

README.md

LLVM Linker (lld)

This directory and its subdirectories contain source code for the LLVM Linker, a modular cross platform linker which is built as part of the LLVM compiler infrastructure project.

lld is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.