bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/26978] Inconsistency for defined foo@v1 and foo@@v1


From: hjl.tools at gmail dot com
Subject: [Bug ld/26978] Inconsistency for defined foo@v1 and foo@@v1
Date: Tue, 01 Dec 2020 14:45:08 +0000

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]