https://sourceware.org/bugzilla/show_bug.cgi?id=26978
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hjl.tools at gmail dot com
Resolution|--- |NOTABUG
Status|UNCONFIRMED |RESOLVED
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Fangrui Song from comment #0)
>
> % ld.bfd -shared --version-script=ver def1.o hid1.o
> ld.bfd: hid1.o: in function `foo_v1':
> (.text+0x0): multiple definition of `foo@@v1'; def1.o:(.text+0x0): first
> defined here
> % ld.bfd -shared --version-script=ver def1w.o hid1.o
> ld.bfd: hid1.o: in function `foo_v1':
> (.text+0x0): multiple definition of `foo@v1'
> ld.bfd: hid1.o:(*IND*+0x0): multiple definition of `foo'
Correct behavior. Otherwise, we will get
Symbol table '.dynsym' contains 4 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000001000 0 NOTYPE WEAK DEFAULT 7 foo@@v1
2: 0000000000001002 0 NOTYPE GLOBAL DEFAULT 7 foo_v1
3: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS v1
and the weak foo@@v1 overrides the non-weak foo@v1.
--
You are receiving this mail because:
You are on the CC list for the bug.