<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: same symbol across shared libraries in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559631#M722772</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I got sidetracked for awhile and haven't been able to look at the problem.&lt;BR /&gt;&lt;BR /&gt;After looking at the solutions proposed, we have the exact same issues that I'm sure you have, that is:&lt;BR /&gt;for 1) We don't have the source code&lt;BR /&gt;for 2) We do not want to statically link either library&lt;BR /&gt;for 3) Forcing the load in the reverse order would cause the exact same problem for the other library.&lt;BR /&gt;&lt;BR /&gt;So, no, I don't have a solution yet.  I'll post a reply if I do find a solution that works for us.&lt;BR /&gt;&lt;BR /&gt;Sorry,&lt;BR /&gt;&lt;BR /&gt;SC</description>
    <pubDate>Tue, 23 Oct 2001 19:39:37 GMT</pubDate>
    <dc:creator>Steve Carlin</dc:creator>
    <dc:date>2001-10-23T19:39:37Z</dc:date>
    <item>
      <title>same symbol across shared libraries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559628#M722769</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;My problem is this:&lt;BR /&gt;&lt;BR /&gt;I have two shared libraries, one that dynamically links with db2 shared libraries and one that dynamically links with odbc shared libraries.  The functions in these underlying shared libraries are exactly the same (e.g. SQLConnect() ).&lt;BR /&gt;&lt;BR /&gt;My application dynamically loads the library linked with db2 shared library first.  Later on, my application dynamically loads the odbc shared library.  The problem occurs when I call the SQLConnect() function within my odbc shared library.  It is calling the wrong SQLConnect! (the one within the db2 library as opposed to the one within the odbc library).&lt;BR /&gt;&lt;BR /&gt;Is there a linker option that I am missing?  I did a scan through the man pages, but I didn't see anything.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;SC</description>
      <pubDate>Tue, 31 Jul 2001 23:08:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559628#M722769</guid>
      <dc:creator>Steve Carlin</dc:creator>
      <dc:date>2001-07-31T23:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: same symbol across shared libraries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559629#M722770</link>
      <description>It sounds like the dynamic linker is getting confused... how is it to know which SQLConnect() you want?  So, it gives you the first it finds (the first loaded).&lt;BR /&gt;&lt;BR /&gt;There are three things that I can think of that you can do to resolve this...&lt;BR /&gt;&lt;BR /&gt;1. Change the name of the SQLCOnnect in one of the libraries, if you have source.&lt;BR /&gt;2. Statically link the odbc library to the executable.&lt;BR /&gt;3. Force the load of the odbc library before the db2 library, like this:&lt;BR /&gt;&lt;BR /&gt;if ((hndl_foo = shl_load("libfoo.sl",&lt;BR /&gt;     BIND_IMMEDIATE, 0)) == NULL)&lt;BR /&gt;   perror("shl_load: error loading libfoo.sl"), exit(1);&lt;BR /&gt;&lt;BR /&gt;Good luck</description>
      <pubDate>Fri, 03 Aug 2001 18:06:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559629#M722770</guid>
      <dc:creator>Vincent Fleming</dc:creator>
      <dc:date>2001-08-03T18:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: same symbol across shared libraries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559630#M722771</link>
      <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;We are having the exact same problem with db2 and odbc.&lt;BR /&gt;&lt;BR /&gt;I was wondering if you were able to resolve your problem.  If so could you please tell me what you did.&lt;BR /&gt;&lt;BR /&gt;Looking at Vincent's answer, 1 is impossible, 2 might work but will cause other problems for us and 3 doesn't work.&lt;BR /&gt;&lt;BR /&gt;Thanks for you time,&lt;BR /&gt;Myriam.</description>
      <pubDate>Tue, 23 Oct 2001 19:11:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559630#M722771</guid>
      <dc:creator>Myriam Boileau</dc:creator>
      <dc:date>2001-10-23T19:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: same symbol across shared libraries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559631#M722772</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I got sidetracked for awhile and haven't been able to look at the problem.&lt;BR /&gt;&lt;BR /&gt;After looking at the solutions proposed, we have the exact same issues that I'm sure you have, that is:&lt;BR /&gt;for 1) We don't have the source code&lt;BR /&gt;for 2) We do not want to statically link either library&lt;BR /&gt;for 3) Forcing the load in the reverse order would cause the exact same problem for the other library.&lt;BR /&gt;&lt;BR /&gt;So, no, I don't have a solution yet.  I'll post a reply if I do find a solution that works for us.&lt;BR /&gt;&lt;BR /&gt;Sorry,&lt;BR /&gt;&lt;BR /&gt;SC</description>
      <pubDate>Tue, 23 Oct 2001 19:39:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559631#M722772</guid>
      <dc:creator>Steve Carlin</dc:creator>
      <dc:date>2001-10-23T19:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: same symbol across shared libraries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559632#M722773</link>
      <description>You may get the behavior you want by using dlopen with the RTLD_LOCAL flag.&lt;BR /&gt;dlopen is available for 32 bit programs on 11.00 by getting a current linker tools patch such as PHSS_23440 .&lt;BR /&gt;In the case of 32 bit executables the dlopen function is in libdld.sl rather than libdl.sl.&lt;BR /&gt;</description>
      <pubDate>Tue, 23 Oct 2001 20:31:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559632#M722773</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2001-10-23T20:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: same symbol across shared libraries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559633#M722774</link>
      <description>OK, this sounds very promising.  I was using shl_load originially because the dlopen didn't exist on HP-10.  &lt;BR /&gt;&lt;BR /&gt;But I'm still not there yet.  The dlopen works, but my first attempt to use dlsym always returns NULL.  The dlopen/dlsym that I have works on other UNIX platforms.  &lt;BR /&gt;&lt;BR /&gt;I have a feeling that it has something to do with the function not being exported right.  I tried using the +ee link object, but it didn't work.  I would appreciate any help you can give.  In the meantime, I'll keep looking.  &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;SC</description>
      <pubDate>Mon, 12 Nov 2001 21:37:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559633#M722774</guid>
      <dc:creator>Steve Carlin</dc:creator>
      <dc:date>2001-11-12T21:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: same symbol across shared libraries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559634#M722775</link>
      <description>You can check shared library symbol export and import lists for 32-bit excutables using&lt;BR /&gt;"odump -slexportlist" and&lt;BR /&gt;"odump -slimportlist".&lt;BR /&gt;odump is delivered as part of PHSS_24303.  For 64 bit executables use&lt;BR /&gt;"elfdump -t".&lt;BR /&gt;You might get useful complaints from dld.sl by setting&lt;BR /&gt;"export _HP_DLDOPTS=-warnings"&lt;BR /&gt;as described in "man dld.sl".&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Nov 2001 20:24:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559634#M722775</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2001-11-13T20:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: same symbol across shared libraries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559635#M722776</link>
      <description>Hey there!&lt;BR /&gt;&lt;BR /&gt;I've just had the same problem under the same circonstances.&lt;BR /&gt;&lt;BR /&gt;I got 2 wrapper libraries, one linking to db2, the other linking to oracle. I dynamically load the wrappers (with calls to shl_load) in my application when a database connection is needed, and the second wrapper loaded gets symbols resolved from the wrong library.&lt;BR /&gt;&lt;BR /&gt;The problem is that both the oracle and the db2 libs export symbols with the same name.&lt;BR /&gt;&lt;BR /&gt;Two ways to get rid of the problem:&lt;BR /&gt;- pass the BIND_FIRST flag to shl_load when loading the wrapper libs. When loading the second wrapper (say the wrapper to db2), all the needed libs (that is the db2 libs) will be placed at the head of the symbol search order, ensuring that the dynamic linker resolves all the needed symbols in the db2 libs, and not in the oracle libs (that would already be loaded)&lt;BR /&gt;- build the wrapper libs using -Wl,-Bsymbolic option, causing all the unresolved symbols in the library to be resolved internally (if possible)&lt;BR /&gt;&lt;BR /&gt;I just hope it helps!&lt;BR /&gt;POC</description>
      <pubDate>Wed, 16 Jan 2002 18:15:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/same-symbol-across-shared-libraries/m-p/2559635#M722776</guid>
      <dc:creator>Pierre-Olivier Ceffis</dc:creator>
      <dc:date>2002-01-16T18:15:24Z</dc:date>
    </item>
  </channel>
</rss>

