<?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: shared libraries - different behaviour in hp-ux and linux in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233399#M60587</link>
    <description>Tnx for the response.&lt;BR /&gt;You are right, i am not porting to integrity.&lt;BR /&gt;&lt;BR /&gt;So the only HP-UX part of the question is:&lt;BR /&gt;&lt;BR /&gt;Why do i *not* get an error on HP-UX with this example.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Define "c" or provide the shlib that has the definition.&lt;BR /&gt;&lt;BR /&gt;This will work in my example. But in real life in the sw i am porting, providing the shlibs leads to other undefined symbols and multiple definitions.&lt;BR /&gt;&lt;BR /&gt;Greetings,&lt;BR /&gt;Joachim</description>
    <pubDate>Mon, 05 Apr 2010 19:22:14 GMT</pubDate>
    <dc:creator>jj458</dc:creator>
    <dc:date>2010-04-05T19:22:14Z</dc:date>
    <item>
      <title>shared libraries - different behaviour in hp-ux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233397#M60585</link>
      <description>I have a problem with different behaviour of shared libraries in HP-UX and in Linux.&lt;BR /&gt;&lt;BR /&gt;A shared library a.sl contains a module a.c with 2 functions a and b.&lt;BR /&gt;Function b is calling some other function c, not contained in the library.&lt;BR /&gt;&lt;BR /&gt;My main program is only calling a, does not need b (and so not c).&lt;BR /&gt;&lt;BR /&gt;On HP-UX 11.11 PA-RISC this is working.&lt;BR /&gt;On Linux i get an unresolved symbol c when im am linking main.&lt;BR /&gt;&lt;BR /&gt;Commands on HP-UX:&lt;BR /&gt;        cc +z -c main.c&lt;BR /&gt;        cc +z -c a.c&lt;BR /&gt;        ld -b -o a.sl a.o&lt;BR /&gt;        cc +z main.o a.sl -o main&lt;BR /&gt;        ./main&lt;BR /&gt;        hello world&lt;BR /&gt;&lt;BR /&gt;Commands on Linux:&lt;BR /&gt;        cc    -c -o main.o main.c&lt;BR /&gt;        cc    -c -o a.o a.c&lt;BR /&gt;        ld -shared -o a.so a.o&lt;BR /&gt;        cc   main.o a.so   -o main&lt;BR /&gt;        a.so: undefined reference to `c'&lt;BR /&gt;&lt;BR /&gt;same result on Linux with liba.so:&lt;BR /&gt;        ld -shared -o liba.so a.o&lt;BR /&gt;        cc -L. -la  main.o   -o main&lt;BR /&gt;        ./liba.so: undefined reference to `c'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Im am porting a programs from HP-UX to Linux. Is there a solution for this kind of problem?&lt;BR /&gt;&lt;BR /&gt;I hope im am using the right forum, because this conciders both HP-UX and Linux.&lt;BR /&gt;&lt;BR /&gt;Joachim</description>
      <pubDate>Mon, 05 Apr 2010 13:21:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233397#M60585</guid>
      <dc:creator>jj458</dc:creator>
      <dc:date>2010-04-05T13:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: shared libraries - different behaviour in hp-ux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233398#M60586</link>
      <description>I'll ask the moderators to move this to Linux.  This has nothing to do with HP-UX, unless you were porting to Integrity.&lt;BR /&gt;&lt;BR /&gt;If you used the ELF linker you would get a shlib unsat warning.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Is there a solution for this kind of problem?&lt;BR /&gt;&lt;BR /&gt;Define "c" or provide the shlib that has the definition.</description>
      <pubDate>Mon, 05 Apr 2010 17:50:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233398#M60586</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-04-05T17:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: shared libraries - different behaviour in hp-ux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233399#M60587</link>
      <description>Tnx for the response.&lt;BR /&gt;You are right, i am not porting to integrity.&lt;BR /&gt;&lt;BR /&gt;So the only HP-UX part of the question is:&lt;BR /&gt;&lt;BR /&gt;Why do i *not* get an error on HP-UX with this example.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Define "c" or provide the shlib that has the definition.&lt;BR /&gt;&lt;BR /&gt;This will work in my example. But in real life in the sw i am porting, providing the shlibs leads to other undefined symbols and multiple definitions.&lt;BR /&gt;&lt;BR /&gt;Greetings,&lt;BR /&gt;Joachim</description>
      <pubDate>Mon, 05 Apr 2010 19:22:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233399#M60587</guid>
      <dc:creator>jj458</dc:creator>
      <dc:date>2010-04-05T19:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: shared libraries - different behaviour in hp-ux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233400#M60588</link>
      <description>You could link with&lt;BR /&gt;cc -Wl,--allow-shlib-undefined main.o a.so -o main&lt;BR /&gt;on linux.&lt;BR /&gt;&lt;BR /&gt;  The 32-bit HP-UX linker defaults to allowing shared libraries to have undefined symbols when linking a program.  (The 64-bit HP-UX linker defaults to an error just as linux does and requires +allowunsats.)&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Apr 2010 00:34:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233400#M60588</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2010-04-06T00:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: shared libraries - different behaviour in hp-ux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233401#M60589</link>
      <description>&amp;gt;Why do I *not* get an error on HP-UX with this example?&lt;BR /&gt;&lt;BR /&gt;Because you do, on Integrity.  But it's a warning.  (Standard is better than better.  :-)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Mike: The 64-bit HP-UX linker defaults to an error just as linux does and requires +allowunsats.&lt;BR /&gt;&lt;BR /&gt;No, if the unsats are in a shlib, it's a warning.&lt;BR /&gt;ld: (Warning) Unsatisfied symbol "c" in file liba.so</description>
      <pubDate>Tue, 06 Apr 2010 02:54:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233401#M60589</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-04-06T02:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: shared libraries - different behaviour in hp-ux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233402#M60590</link>
      <description>Hello.&lt;BR /&gt;&lt;BR /&gt;You can resort to "lazy" linking. From what I can see this is the default on HP-UX.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Goran</description>
      <pubDate>Tue, 06 Apr 2010 04:13:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233402#M60590</guid>
      <dc:creator>Goran Koruga</dc:creator>
      <dc:date>2010-04-06T04:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: shared libraries - different behaviour in hp-ux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233403#M60591</link>
      <description>Tnx to all for your help!&lt;BR /&gt;&lt;BR /&gt;Default on my HP-UX 11.11 64 Bit PA-RISC seems to be lazy linking without warning.&lt;BR /&gt;&lt;BR /&gt;Solution for Linux is:&lt;BR /&gt;- Compile with -fpic or -fPIC&lt;BR /&gt;- Link with&lt;BR /&gt;  --allow-shlib-undefined (no warning at link time)&lt;BR /&gt;    or&lt;BR /&gt;  --warn-unresolved-symbols&lt;BR /&gt;&lt;BR /&gt;Joachim</description>
      <pubDate>Tue, 06 Apr 2010 12:51:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233403#M60591</guid>
      <dc:creator>jj458</dc:creator>
      <dc:date>2010-04-06T12:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: shared libraries - different behaviour in hp-ux and linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233404#M60592</link>
      <description>(solution see last post)</description>
      <pubDate>Fri, 09 Apr 2010 23:49:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shared-libraries-different-behaviour-in-hp-ux-and-linux/m-p/5233404#M60592</guid>
      <dc:creator>jj458</dc:creator>
      <dc:date>2010-04-09T23:49:52Z</dc:date>
    </item>
  </channel>
</rss>

