This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Symbol versioning question..


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]