Bug 28195

Summary: gold: Spurious "warning: wildcard match appears in both version"
Product: binutils Reporter: Fangrui Song <i>
Component: goldAssignee: Cary Coutant <ccoutant>
Status: UNCONFIRMED ---    
Severity: normal CC: ian
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Fangrui Song 2021-08-05 17:00:14 UTC
cat > ./a.s <<eof
.symver aa_2_29, aa@GLIBC_2.29
.globl aa_2_29
aa_2_29:
  nop

.symver bb_2_30, aa@GLIBC_2.30
.globl bb_2_30
aa_2_30:
  nop
eof
cat > ./a.ver <<eof
GLIBC_2.29 { local: *; };
GLIBC_2.30 { local: *; };
eof
cc -c a.s


% gold --version-script a.ver a.o -shared
gold: warning: wildcard match appears in both version 'GLIBC_2.29' and 'GLIBC_2.30' in script

The example is derived from glibc. I think the warning should be suppressed: GLIBC_2.29 { global: xxx; yyy; local: *; };  can be used to keep xxx@GLIBC_2.29 yyy@GLIBC_2.29 while localizing other *@GLIBC_2.29 non-default version symbols. It's perfectly fine for multiple version nodes to localize their non-default version symbols.