Skip to content
Commit 3e8a461b authored by George Rimar's avatar George Rimar
Browse files

[ELF] - Give a symbol version extracted from name a priority over version set by script.

This fixes PR33712.

Imagine following script and code:

VER1 { global: foo; local: *; };
VER2 { global: foo; };

.global bar
bar:
.symver bar, foo@VER1

.global zed
zed:
.symver zed, foo@@VER2

We add foo@@VER2 as foo to symbol table, because have to resolve references to
foo for default symbols.
Later we are trying to assign symbol versions from script. For that we are searching for 'foo'
again. Here it is placed under VER1 and VER2 at the same time, we find it twice and trying to
set version again both times, hence LLD shows a warning.
Though sample code is correct: we have 2 different versions of foo.

Patch gives a symbol version extracted from name a priority over version set by script.

Differential revision: https://reviews.llvm.org/D35207

llvm-svn: 307792
parent 53145213
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment