[Date Prev][Date Next] [Chronological] [Thread] [Top]

libldap and libldap_r in the same process

A given (threaded) program makes use of libldap_r. It now also wants to 
make use of, say, libcurl. On certain systems, libcurl happens to be 
linked against libldap (not _r).

Eventually, both libldap and libldap_r end up in the process image of my 
program, and a symbol like "ldap_init" may point to the function of 
either library file. The threaded program may end up unexpectedly been 
given the non-threaded functions, depending on how the runtime linker 
loaded said libraries and binds the symbols. (I am seeing crashes in a 
large program's initialization because of this.)

There is a 7-year old post indicating libldap should get locking/
be replaced by libldap_r.
To date, openldap still consists of the two libraries.
What are the preferred options to go forward here?

* Killing non-threaded libldap in openldap for real
If not,
* Should curl have used -lldap_r instead of -lldap?
* Should Linux distributions make libldap and libldap_r be the same thing?
* Should libldap and libldap_r be augmented by ELF symbol versions?
* All of the above? :)