This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld: switching symbol versions
- From: Nikos Mavrogiannopoulos <n dot mavrogiannopoulos at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Sat, 20 Sep 2014 08:50:42 +0200
- Subject: Re: ld: switching symbol versions
- Authentication-results: sourceware.org; auth=none
- References: <CAJU7zaJP_iBdX7EqmUQcMVQS1Z=4Ycpfy7nABnowLyo-Yt45MQ at mail dot gmail dot com> <541B6380 dot 8050407 at redhat dot com>
On Fri, Sep 19, 2014 at 12:58 AM, Richard Henderson <rth@redhat.com> wrote:
>> NEW {
>> my symbol;
>> }
>>
>> XXX {
>> my_symbol;
>> }
>> And it seems to achieve what I need. Old programs that use the XXX ABI
>> work seamlessly and new programs link against the NEW ABI. My question
>> is, whether this behavior is random, or is the intended one and I can
>> rely on it.
> I'd be surprised if this really does what you want.
> You want the old symbols to be defined with non default versions
> my_symbol@XXX
> and new symbols to be defined with default versions
> my_symbol@@NEW
Correct.
> As far as I know from glibc development, this requires defining the symbols in
> this manner within the object files. C.f.
> glibc/sysdeps/unix/sysv/linux/xstat64.c
> which exports __xstat64 with both GLIBC_2_1 and GLIBC_2_2 versions.
Ok, so my understanding of your reply is that using the script file
there is no way to set the default version of the symbols, and the
fact that the first listed symbol was used by default is purely
incidental.
thanks,
Nikos