[Top][All Lists]

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

Re: ltdl support for versioned symbols

From: Ludovic Courtès
Subject: Re: ltdl support for versioned symbols
Date: Sun, 13 Mar 2011 21:32:05 +0100
User-agent: Gnus/5.110013 (No Gnus v0.13) Emacs/23.3 (gnu/linux)


Ralf Wildenhues <address@hidden> writes:

> * Ludovic Courtès wrote on Sun, Mar 13, 2011 at 05:31:17PM CET:
>> Ralf Wildenhues writes:
>> > * Ludovic Courtès wrote on Sat, Mar 12, 2011 at 02:35:11PM CET:
>> >> I’m thinking about adding this to ltdl:
>> >> 
>> >>   void *lt_dlvsym (lt_dlhandle HANDLE, const char *NAME,
>> >>                    const char *VERSION);
>> >> 
>> >> On GNU systems[*], this would call ‘dlvsym’; on other systems, it would
>> >> call ‘lt_dlsym’.
>> >
>> > Hmmyes, maybe.
>> >
>> > You know about copyright assignment for nontrivial additions, HACKING,
>> > and that we love to see testsuite coverage for new features, I suppose?
>> > ;-)
>> I do :-), I just wanted to make sure there’s interest in it.
> Well, it's a bit of a bummer that encoding of a symbol version can not
> be done in a portable manner.  That makes this abstraction rather leaky.

Agreed.  OTOH, aligning on the least common denominator means giving up
on such useful features.  “Choosing between portability and innovation”,
they say...

Guile uses ltdl to load extensions, which is great because it’s
portable.  Now, Guile has a foreign function interface (FFI) that allows
users to dlopen a shared library and then call some of its symbols
directly from Scheme, using libffi behind the scenes.

This works great, but a significant drawback is that there’s no way to
check at run-time that you’re actually using something compatible with
the ABI you initially targeted.  Symbol versioning is one way to address

>> >> [*] Solaris ld supports symbol versioning but seems to lack ‘dlvsym’.
>> >
>> > However, it seems to have a bit weaker way of verifying the presence of
>> > some version in a shared library by calling dlsym (handle, version):
>> > http://www.shrubbery.net/solaris9ab/SUNWdev/LLM/p26.html#CHAPTER5-IX522
>> That doesn’t seem very useful to me because there’s nothing you can do
>> if a given symbol is available under several versions, and it doesn’t
>> allow you to know whether the symbol you’re interested in available in a
>> specific version.
> But at least it could tell you if such a version is not available at
> all, no?

Apparently yes.  Better than nothing.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]