Re: HPUX 11.11 shared library loader issue



russiandevil@xxxxxxxxx writes:

It would appear as though I get different OpenLDAP version information
being shown, depending on whether my test app is run (and loads shared
library B), or the executable A is run and does the loading/executing.
I'm just curious as to why this is happening... I would have expected
that since shared library B links with static OpenLDAP libraries, there
shouldn't be any conflict...

Your expectations are incorrect (possibly originate from Win32).

If both libraries define some of the same symbols (which is likely),
then by default the first library that defines certain symbol "wins"
(as in, its symbol is used everywhere).

Is this the standard behaviour on HPUX 11.11, or some known loader bug?

This is "standard" on all UNIXes (except AIX).

Is there some way around it (apart from both
executable A and library B being built using same version of OpenLDAP)?

You can (and should) hide (prevent from being exported) ldap symbols
in library B. Read "man ld", the '-h' option.

p.s. by the way, this setup seems to work okay (no crashes) on Windows,
AIX,

Windows and AIX use different export strategy ...

Solaris and Linux...

Possibly work "by chance" (i.e. the bug is there, you just haven't
observed it yet).

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
.



Relevant Pages

  • Re: My first .a file, but linker cant resolve references
    ... The order of sources and libraries on the ... > In addition to checking the original source and generating a new set ... "strings" is the wrong tool for examining objects or libraries. ... In order to understand recursion you must first understand recursion. ...
    (comp.unix.programmer)
  • Re: Application cannot find shared object
    ... > BTW, is there a way to add ... > /usr/lib to the list of the search paths that the system looks for ... are a lot of 32-bit libraries there, and every 64-bit process on the ... In order to understand recursion you must first understand recursion. ...
    (comp.unix.programmer)
  • Re: segmentation fault when using shared library
    ... > The old version had static libraries, but the new version has shared. ... How do you know this happened before entering main? ... or with the way your program calls into the "driver" ... In order to understand recursion you must first understand recursion. ...
    (comp.os.linux.development.apps)
  • Re: symbol name corresponding to a address
    ... > addresses for different executables(I discovered it using gdb). ... The libraries are usually loaded into the first ... int main ... In order to understand recursion you must first understand recursion. ...
    (comp.unix.programmer)
  • Re: Overview of Dynamic Linking?
    ... a.out may end up depending on 'libfoo.so', or 'libfoo.so.1', or even ... compiler driver could be adding all kinds of libraries besides glibc. ... In order to understand recursion you must first understand recursion. ...
    (comp.os.linux.development.apps)