https://sourceware.org/bugzilla/show_bug.cgi?id=26979
Bug ID: 26979 Summary: Visibility of undefined foo@v1 should constrain defined foo@@v1 Product: binutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: i at maskray dot me Target Milestone: --- cat > ./def1.s <<eof .globl foo .symver foo, foo@@@v1 foo: eof cat > ./ref1.s <<eof .protected foo_v1 .symver foo_v1, foo@v1 call foo_v1 eof cat > ./ver <<eof v1 {}; eof gcc -c *.s % ld.bfd -shared --version-script=ver ref1.o def1.o Symbol table '.dynsym' contains 3 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS v1 2: 0000000000001025 0 NOTYPE GLOBAL DEFAULT 9 foo@@v1 % gold -shared --version-script=ver ref1.o def1.o Symbol table '.dynsym' contains 6 entries: Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND 1: 0000000000002000 0 NOTYPE GLOBAL DEFAULT 8 _end 2: 0000000000002000 0 NOTYPE GLOBAL DEFAULT 8 _edata 3: 00000000000002bd 0 NOTYPE GLOBAL PROTECTED 7 foo@@v1 4: 0000000000002000 0 NOTYPE GLOBAL DEFAULT 8 __bss_start 5: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS v1 The gold behavior is more sensible: the visibility of the output foo@@v1 is changed to STV_PROTECTED. Note, if def1.s defines the non-default version foo@v1 instead, both GNU ld and gold produce a protected foo@v1. -- You are receiving this mail because: You are on the CC list for the bug.