Symbol clash when application loads two similar libraries

"gireesh" <>
8 Jun 2005 16:03:09 -0400

          From comp.compilers

Related articles
Symbol clash when application loads two similar libraries (gireesh) (2005-06-08)
| List of all articles for this month |

From: "gireesh" <>
Newsgroups: comp.compilers
Date: 8 Jun 2005 16:03:09 -0400
Keywords: linker, question
Posted-Date: 08 Jun 2005 16:03:09 EDT

I have a problem with symbol clash when an application loads two
libraries with same symbols.

passwd utility in Linux dynamically links (Uses -l linker option) to
OpenLDAP's sdk library, which exposes a set LDAP symbols.
Now, following a configurable option, passwd loads (dlopen) our
Application which is internally linked to a different LDAP SDK library
(our own) which also exposes the same symbols as that of OpenLDAP's
SDK. This causes a symbol clash and the calls which are supposed to
get resolved into our LDAP SDK library is getting resolved in
OpenLDAP's library.


links loads links
OpenLDAP library <-----PASSWD-------->Our Application-------->OurLDAP

Is there any way to force the application to resolve the symbols from
our library itself?

I'm using Linux(Suse,Redhat) and gcc 3.2

I'm used -Bsymbolic linker option in our application. This is not
making any difference. Tried to statically link our LDAP SDK library
with our application , but this also did not help.

Basically my observation is, if PASSWD dynamically links to our
Application (-l linker option), -BSymbolic will solve the issue. But
this is not acceptable in our scenario.

I appreciate any help to resolve this problem.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.