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.
- ELF extension for starting symbol search from module dep... Luca Barbieri
- Re: ELF extension for starting symbol search from m... Roland McGrath
- Re: ELF extension for starting symbol search fr... Luca Barbieri
- Re: ELF extension for starting symbol search from m... Maciej W. Rozycki
- Re: ELF extension for starting symbol search fr... Jakub Jelinek
- Re: ELF extension for starting symbol searc... Luca Barbieri
- Re: ELF extension for starting symbol search fr... Luca Barbieri
- Re: ELF extension for starting symbol searc... Maciej W. Rozycki
- Re: ELF extension for starting symbol s... Luca Barbieri
- Re: ELF extension for starting sym... Maciej W. Rozycki
- Re: ELF extension for starting... Luca Barbieri

