This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Symbol versioning question..
- From: Marcus Shawcroft <marcus dot shawcroft at linaro dot org>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Cc: Richard Henderson <rth at twiddle dot net>
- Date: Wed, 24 Jul 2013 17:56:14 +0100
- Subject: Re: Symbol versioning question..
- References: <CABXK9ndVsUhXdx5YfV+NDSa99daV9wJtj1ucMAxcH6zQmbChqg at mail dot gmail dot com> <51E96F11 dot 9030300 at twiddle dot net>
On 19 July 2013 17:53, Richard Henderson <rth@twiddle.net> wrote:
> This is a known problem with the Versions file, and associated scripts.
> This same thing happened for Alpha and the __sqrt*_finite symbols.
>
> See e.g. ports/sysdeps/alpha/soft-fp/e_sqrtl.c for how I solved it.
>
Thank you, that was helpful. The solution for _mcount boils down to:
#if SHLIB_COMPAT (libc, GLIBC_2_17, GLIBC_2_18)
versioned_symbol (libc, __mcount, _mcount, GLIBC_2_18);
#else
strong_alias (__mcount, _mcount);
#endif
Which results in:
00000000000c81cc g DF .text 000000000000018c GLIBC_2.18 _mcount
00000000000c81cc w DF .text 000000000000018c GLIBC_2.17 mcount
.. however, I'm struggling with the weak definition of mcount, I've
experimented and dug around in the code base and can find no example
of how to version a weak symbol. A second use of versioned_symbol
results the assembler griping:
There are two issues:
1)
weak_alias (__mcount, mcount)
versioned_symbol (libc, __mcount, mcount, GLIBC_2_18);
Results in:
00000000000c81cc g DF .text 000000000000018c GLIBC_2.18 mcount
.. note the absence of weak.
2) Versioning two symbols from the same base:
versioned_symbol (libc, __mcount, _mcount, GLIBC_2_18);
versioned_symbol (libc, __mcount, mcount, GLIBC_2_18);
results in:
mcount.s:10: Error: multiple versions
[`mcount@@GLIBC_2.18'|`_mcount@@GLIBC_2.18'] for symbol `__mcount'
Suggestions welcome.
Cheers
/Marcus