<?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: shl_load function Problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shl-load-function-problem/m-p/2455671#M770442</link>
    <description>The libAmdOra.sl library is linked against libpthread.sl.&lt;BR /&gt;The libpthread.sl library contains thread local storage variables.&lt;BR /&gt;The shl_load call can't bring in shared libraries that declare thread local storage variables.&lt;BR /&gt;You will need to link your a.out with at least libpthread.sl so it will be present before shl_load.&lt;BR /&gt;You can check what shared libraries are brought in by using "odump -sllibloadlist libAmdOra.sl".  You can&lt;BR /&gt;check for the use of TLS in a shared library by using nm and grep to look for "$TBSS$" data-&lt;BR /&gt;# nm /usr/lib/libpthread.sl | grep TBSS    &lt;BR /&gt;__self_pthread_d    |         0|extern|data   |$TBSS$&lt;BR /&gt;__self_pthread_t    |         8|extern|data   |$TBSS$&lt;BR /&gt;&lt;BR /&gt;Thread local storage is discussed in "man pthread",&lt;BR /&gt;&lt;A href="http://devresource.hp.com/STK/man/11.00/pthread_3t.html" target="_blank"&gt;http://devresource.hp.com/STK/man/11.00/pthread_3t.html&lt;/A&gt;&lt;BR /&gt;and  in "man shl_load",&lt;BR /&gt;&lt;A href="http://devresource.hp.com/STK/man/11.00/shl_load_3x.html" target="_blank"&gt;http://devresource.hp.com/STK/man/11.00/shl_load_3x.html&lt;/A&gt;&lt;BR /&gt;==========================================================</description>
    <pubDate>Fri, 20 Oct 2000 21:48:40 GMT</pubDate>
    <dc:creator>Mike Stroyan</dc:creator>
    <dc:date>2000-10-20T21:48:40Z</dc:date>
    <item>
      <title>shl_load function Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shl-load-function-problem/m-p/2455670#M770441</link>
      <description>I am having libAmdOra.sl shared library. I wanted to access AmdOraStartup function which is inside that shared library. &lt;BR /&gt;&lt;BR /&gt;FILENAME : TestLib.cpp&lt;BR /&gt;&lt;BR /&gt;#include &lt;DL.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;ERRNO.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;    int status;&lt;BR /&gt;    void *value;&lt;BR /&gt;    shl_t shl_handle = shl_load("libAmdOra.sl",BIND_DEFERRED|DYNAMIC_PATH,0L);&lt;BR /&gt;    if (shl_handle == NULL) &lt;BR /&gt;    {&lt;BR /&gt;        printf("shl_load error. rc = %sn", strerror(errno));&lt;BR /&gt;        return -1;&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;    printf("shl_load successn");&lt;BR /&gt;&lt;BR /&gt;    status = shl_findsym(&amp;amp;shl_handle, "AmdOraStartup", 0, value);&lt;BR /&gt;    if (status == -1)&lt;BR /&gt;    {&lt;BR /&gt;        printf("findSym error. rc = %sn",strerror(errno));&lt;BR /&gt;        return -1;&lt;BR /&gt;    }&lt;BR /&gt;    printf("findSym successn");    &lt;BR /&gt;    return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;I am working on HPUX11.0 machine &amp;amp; using aCC 3.15 compiler.&lt;BR /&gt;&lt;BR /&gt;TESTDIR&amp;gt;aCC +DAportable TestLib.cpp -ldld&lt;BR /&gt;TESTDIR&amp;gt;a.out&lt;BR /&gt;/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /usr/lib/libpthread.1&lt;BR /&gt;/usr/lib/dld.sl: Exec format error&lt;BR /&gt;shl_load error. rc = Exec format error&lt;BR /&gt;&lt;BR /&gt;----------------------&lt;BR /&gt;This shared library libAmdOra.sl contains all oracle related functions including AmdOraStartup function. made using -Z (compile) optio) and -b (link) option of aCC.&lt;BR /&gt;&lt;BR /&gt;If anybody knows answer, please mail me.&lt;BR /&gt;Thank You&lt;BR /&gt;&lt;BR /&gt;-Pravin&lt;/ERRNO.H&gt;&lt;/STDIO.H&gt;&lt;/STRING.H&gt;&lt;/DL.H&gt;</description>
      <pubDate>Thu, 19 Oct 2000 15:45:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shl-load-function-problem/m-p/2455670#M770441</guid>
      <dc:creator>Pravin B</dc:creator>
      <dc:date>2000-10-19T15:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: shl_load function Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shl-load-function-problem/m-p/2455671#M770442</link>
      <description>The libAmdOra.sl library is linked against libpthread.sl.&lt;BR /&gt;The libpthread.sl library contains thread local storage variables.&lt;BR /&gt;The shl_load call can't bring in shared libraries that declare thread local storage variables.&lt;BR /&gt;You will need to link your a.out with at least libpthread.sl so it will be present before shl_load.&lt;BR /&gt;You can check what shared libraries are brought in by using "odump -sllibloadlist libAmdOra.sl".  You can&lt;BR /&gt;check for the use of TLS in a shared library by using nm and grep to look for "$TBSS$" data-&lt;BR /&gt;# nm /usr/lib/libpthread.sl | grep TBSS    &lt;BR /&gt;__self_pthread_d    |         0|extern|data   |$TBSS$&lt;BR /&gt;__self_pthread_t    |         8|extern|data   |$TBSS$&lt;BR /&gt;&lt;BR /&gt;Thread local storage is discussed in "man pthread",&lt;BR /&gt;&lt;A href="http://devresource.hp.com/STK/man/11.00/pthread_3t.html" target="_blank"&gt;http://devresource.hp.com/STK/man/11.00/pthread_3t.html&lt;/A&gt;&lt;BR /&gt;and  in "man shl_load",&lt;BR /&gt;&lt;A href="http://devresource.hp.com/STK/man/11.00/shl_load_3x.html" target="_blank"&gt;http://devresource.hp.com/STK/man/11.00/shl_load_3x.html&lt;/A&gt;&lt;BR /&gt;==========================================================</description>
      <pubDate>Fri, 20 Oct 2000 21:48:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shl-load-function-problem/m-p/2455671#M770442</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2000-10-20T21:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: shl_load function Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shl-load-function-problem/m-p/2455672#M770443</link>
      <description>I think you are going to get a crash (in shl_findsym) after you get shl_load to return successfully.&lt;BR /&gt;&lt;BR /&gt;Because you want shl_findsym( ) to output a pointer to the stated function (AmdOraStartup), you have to provide it the address of a location where it can write a pointer-to-the-function whose signature should be known.  See the nice example in the HP-UX Linker and Libraries User's Guide:&lt;BR /&gt;&lt;A href="http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90655/B2355-90655_top.html&amp;amp;con=/hpux/onlinedocs/B2355-90655/00/00/55-con.html&amp;amp;toc=/hpux/onlinedocs/B2355-90655/00/00/55-toc.html&amp;amp;searchterms=shl_findsym&amp;amp;queryid=20001023-045431" target="_blank"&gt;http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90655/B2355-90655_top.html&amp;amp;con=/hpux/onlinedocs/B2355-90655/00/00/55-con.html&amp;amp;toc=/hpux/onlinedocs/B2355-90655/00/00/55-toc.html&amp;amp;searchterms=shl_findsym&amp;amp;queryid=20001023-045431&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Kiran</description>
      <pubDate>Mon, 23 Oct 2000 11:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shl-load-function-problem/m-p/2455672#M770443</guid>
      <dc:creator>Kiran N. Mehta</dc:creator>
      <dc:date>2000-10-23T11:14:16Z</dc:date>
    </item>
  </channel>
</rss>

