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.
Probably easiest way is to give .symver a priority over version script and do not reassign versions.
Looks bfd and gold do the same here.
// Skip symbols containing version info because symbol versions specified by symbol names take precedence over version scripts. See parseSymbolVersion().