bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/27210] ld: Don't suppress foo if foo@v1 is defined


From: i at maskray dot me
Subject: [Bug ld/27210] ld: Don't suppress foo if foo@v1 is defined
Date: Wed, 20 Jan 2021 03:18:35 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27210

--- Comment #7 from Fangrui Song <i at maskray dot me> ---
(In reply to H.J. Lu from comment #6)
> (In reply to Fangrui Song from comment #5)
> > The explanation is not convincing. foo and foo@v1 are two different 
> > symbols. 
> > My example does not use an undefined symbol so I don't see how
> > 
> > > shouldn't be used by ld to satisfy the unversioned reference.
> > 
> > is relevant.
> 
> In a DSO, only foo and foo@@VERSION can point to the same definition
> in .dynsym.

Other versioned dynamic symbols can have the same st_value as well.

% nm -D /lib/x86_64-linux-gnu/libc.so.6 | grep -v U | awk '{if ($1 in s) print
s[$1], $3; else s[$1]=$3}'
__adjtimex@@GLIBC_2.2.5 adjtimex@@GLIBC_2.2.5
alphasort@@GLIBC_2.2.5 alphasort64@@GLIBC_2.2.5
__arch_prctl@@GLIBC_2.2.5 arch_prctl@@GLIBC_2.2.5
__argz_count@@GLIBC_2.2.5 argz_count@@GLIBC_2.2.5
__argz_next@@GLIBC_2.2.5 argz_next@@GLIBC_2.2.5
__argz_stringify@@GLIBC_2.2.5 argz_stringify@@GLIBC_2.2.5
__asprintf@@GLIBC_2.2.5 asprintf@@GLIBC_2.2.5
__backtrace@@GLIBC_2.2.5 backtrace@@GLIBC_2.2.5
__backtrace_symbols@@GLIBC_2.2.5 backtrace_symbols@@GLIBC_2.2.5
__backtrace_symbols_fd@@GLIBC_2.2.5 backtrace_symbols_fd@@GLIBC_2.2.5
__bzero@@GLIBC_2.2.5 bzero@@GLIBC_2.2.5
clock_getcpuclockid@GLIBC_2.2.5 clock_getcpuclockid@@GLIBC_2.17
...



ld producing both 'foo' and 'foo@v1' is totally fine. It may not have
explainable runtime behavior (say foo@@v2 exists) so the user should do
something (usually via a local: pattern in a version script) to suppress 'foo'.
ld does not need to work around the user bug by suppressing 'foo' when 'foo@v1'
is defined.

-- 
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]