Symbol versioning errors in libthr

Kostik Belousov kostikbel at gmail.com
Sun Feb 3 08:54:58 PST 2008


On Sun, Feb 03, 2008 at 08:59:45AM -0700, Peter Wemm wrote:
> On Feb 3, 2008 8:16 AM, Dag-Erling Sm?rgrav <des at des.no> wrote:
> > Here's an excerpt from the RELENG_7 vs HEAD diff of libthr's symbol map:
> >
> > --- pthread.map 13 May 2007 14:12:39 -0000      1.18
> > +++ pthread.map 20 Dec 2007 04:32:28 -0000      1.21
> > @@ -84,9 +84,13 @@
> >         pthread_multi_np;
> >         pthread_mutex_destroy;
> >         pthread_mutex_getprioceiling;
> > +       pthread_mutex_getspinloops_np;
> > +       pthread_mutex_getyieldloops_np;
> >         pthread_mutex_init;
> >         pthread_mutex_lock;
> >         pthread_mutex_setprioceiling;
> > +       pthread_mutex_setspinloops_np;
> > +       pthread_mutex_setyieldloops_np;
> >         pthread_mutex_timedlock;
> >         pthread_mutex_trylock;
> >         pthread_mutex_unlock;
> >
> > These functions are all in FBSD_1.0, but they were introduced after the
> > branch and never MFCed, so if I understand how we've implemented symbol
> > versioning, they should be in FBSD_1.1.
> >
> > Unless someone argues credibly for keeping them in FBSD_1.0, I will move
> > them to FBSD_1.1 in a few days.
> >
> > DES
> 
> I'm not sure I see the point in that.  Consider the not-moving-to-1.1
> case.  If somebody takes an 8.0 binary and runs it on 7.x, then
> they'll get a 'symbol not found' error.  On the other hand, if they're
> moved and somebody tries the same thing, then they still get the same
> kind of 'symbol not found' error but with just one character
> different.
Additional difference is that presence of the version itself is checked
when the image is activated. This means that instead of abort in the
middle of the execution since the
rtld cannot find the symbol, the program gives error on the start.o

AFAIR, this is original (Sun) usage of the versioning, before GNU
extended it to allow individual version per symbol.

I support DES to fix this in the proposed way.
> 
> The point of symbol versioning is to allow incompatible changes.  eg:
> to have a FBSD_1.0 version of  pthread_mutex_getspinloops_np() *AND* a
> FBSD_1.1 version of     pthread_mutex_getspinloops_np() in the library
> at the same time.  The 1.0 instance would presumably be an API/ABI
> conversion wrapper around the newer functions.
> 
> -Peter
> -- 
> Peter Wemm - peter at wemm.org; peter at FreeBSD.org; peter at yahoo-inc.com
> "All of this is for nothing if we don't go to the stars" - JMS/B5
> _______________________________________________
> freebsd-current at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe at freebsd.org"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-threads/attachments/20080203/d1c0f3e7/attachment.pgp


More information about the freebsd-threads mailing list