[PATCH] D21894: [ELF] - Fixed incorrect logic of version assignments when mixing wildcards with values matching.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 07:56:58 PDT 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.

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.

http://reviews.llvm.org/D21894

Files:
  ELF/Config.h
  ELF/SymbolListFile.cpp
  ELF/SymbolTable.cpp
  ELF/SymbolTable.h
  test/ELF/version-wildcard.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21894.62361.patch
Type: text/x-patch
Size: 8468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160630/166806d4/attachment.bin>


More information about the llvm-commits mailing list