ELF extension for starting symbol search from module dependencies
Luca Barbieri
ldb@ldb.ods.org
Thu Aug 22 07:08:00 GMT 2002
On Thu, 2002-08-22 at 08:13, Roland McGrath wrote:
> I think you can get the effect you need just by using -Bsymbolic. In your
> example, build the GTK+ library with -Bsymbolic. If that causes problems
> because some of the library's references should be resolved in the normal
> global scope, then confine the code that uses libpng to a wrapper library
> that you build with -Bsymbolic. Then link the GTK+ library against that
> shared object, and I think you will get the result you need: the GTK+
> library code that uses libpng will be in a DT_SYMBOLIC object and thus
> resolve according to its own dependency on the desired libpng soname,
> while the application is free to link a conflicting libpng in directly.
But -Bsymbolic only puts the module that uses it in front of the search
list so the wrapper will use the library used by the program and will
fail.
You could do this by dlopen'ing libpng and getting symbols from it with
dlsym but this requires source modifications and isn't exactly elegant
(and lazy lookups require even more modifications).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20020822/69f583f2/attachment.sig>
More information about the Libc-alpha
mailing list