This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: ELF extension for starting symbol search from moduledependencies


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).

Attachment: signature.asc
Description: This is a digitally signed message part


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