<?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: dladdr returning _DYNAMIC as function name! in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/dladdr-returning-dynamic-as-function-name/m-p/4557750#M678940</link>
    <description>&amp;gt;I have been using dladdr() for converting code address into symbolic address.&lt;BR /&gt;&lt;BR /&gt;In general this won't work.  It doesn't handle hidden nor static functions.  And for PA, it doesn't handle stubs.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Q1) Is there any other function other than dladdr which would serve my purpose?&lt;BR /&gt;&lt;BR /&gt;Try looking at the Unwind lib: unwind(5)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Q2) Are there any switches to be used while making .so or .o or the exe file ...&lt;BR /&gt;&lt;BR /&gt;By default they should be there unless you use tricky compiler/linker options or the function is static.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Is the result of PSTACK not NM&lt;BR /&gt;&lt;BR /&gt;U_STACK_TRACE(3) should also work.</description>
    <pubDate>Mon, 04 Jan 2010 18:49:52 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2010-01-04T18:49:52Z</dc:date>
    <item>
      <title>dladdr returning _DYNAMIC as function name!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dladdr-returning-dynamic-as-function-name/m-p/4557748#M678938</link>
      <description>&lt;P&gt;Hello :)&lt;BR /&gt;&lt;BR /&gt;I have been using dladdr() for converting code address into symbolic address. I get function name to the corresponding address. &lt;BR /&gt;&lt;BR /&gt;I have a caller function call.c in which I have defined some functions like &lt;BR /&gt;" Iwillallocate() "&lt;BR /&gt;&lt;BR /&gt;which call malloc() etc.&lt;BR /&gt;&lt;BR /&gt;Now i creased an external.so which has a function &lt;BR /&gt;&lt;BR /&gt;void call()&lt;BR /&gt;&lt;BR /&gt;which calls malloc too.&lt;BR /&gt;&lt;BR /&gt;Now when i link this .so with the exe file for call.c ,the dladdr function successfully returns me the fucntion names of the functions in call.c but it returns _DYNAMIC for the fucntion in external.so and does not return the function name call().&lt;BR /&gt;&lt;BR /&gt;when I use nm command n search the symbol table I get:&lt;BR /&gt;&lt;BR /&gt;4: 60000000c0a1b790 : call() + 0x190 (./external.so)&lt;BR /&gt;5: 0000000004000bc0 : _Z13Iwillallocatev() + 0x20 (./test)&lt;BR /&gt;6: 0000000004000b10 : main() + 0x60 (./test)&lt;BR /&gt;7: 60000000c004ddb0 : main_opd_entry() + 0x50 (/usr/lib/hpux32/dld.so)&lt;BR /&gt;&lt;BR /&gt;Ass you can see it gives 60000000c0a1b790 address for call() in external.so 0000000004000bc0 address for Iwillallocate() in ./test (which is my exe file i created)&lt;BR /&gt;&lt;BR /&gt;The address for call() is too high in value.. and hence we get _DYNAMIC as a result when i pass this address in dladdr() and not call() :(.&lt;BR /&gt;&lt;BR /&gt;Now 2 questions:&lt;BR /&gt;&lt;BR /&gt;Q1) Is there any other fucntion other than dladdr which would serve my purpose?&lt;BR /&gt;&lt;BR /&gt;Q2)Are there any switches to be used while making .so or .o or the exe file test which need to be used so that this _DYNAMIC error does not come and I get the correct function names present in external.so .&lt;BR /&gt;&lt;BR /&gt;Thank you experts very much in advance.&lt;BR /&gt;Regards &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. This thread has been moved from HP-UX &amp;gt;&amp;nbsp;General to HP-UX &amp;gt; Languages and Scripting - HP Forums Moderator&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2012 04:22:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dladdr-returning-dynamic-as-function-name/m-p/4557748#M678938</guid>
      <dc:creator>Wkdunreal</dc:creator>
      <dc:date>2012-10-09T04:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: dladdr returning _DYNAMIC as function name!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dladdr-returning-dynamic-as-function-name/m-p/4557749#M678939</link>
      <description>4: 60000000c0a1b790 : call() + 0x190 (./external.so)&lt;BR /&gt;5: 0000000004000bc0 : _Z13Iwillallocatev() + 0x20 (./test)&lt;BR /&gt;6: 0000000004000b10 : main() + 0x60 (./test)&lt;BR /&gt;7: 60000000c004ddb0 : main_opd_entry() + 0x50 (/usr/lib/hpux32/dld.so)&lt;BR /&gt;&lt;BR /&gt;Is the result of PSTACK not NM sorry :D:D!&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 04 Jan 2010 10:23:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dladdr-returning-dynamic-as-function-name/m-p/4557749#M678939</guid>
      <dc:creator>Wkdunreal</dc:creator>
      <dc:date>2010-01-04T10:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: dladdr returning _DYNAMIC as function name!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dladdr-returning-dynamic-as-function-name/m-p/4557750#M678940</link>
      <description>&amp;gt;I have been using dladdr() for converting code address into symbolic address.&lt;BR /&gt;&lt;BR /&gt;In general this won't work.  It doesn't handle hidden nor static functions.  And for PA, it doesn't handle stubs.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Q1) Is there any other function other than dladdr which would serve my purpose?&lt;BR /&gt;&lt;BR /&gt;Try looking at the Unwind lib: unwind(5)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Q2) Are there any switches to be used while making .so or .o or the exe file ...&lt;BR /&gt;&lt;BR /&gt;By default they should be there unless you use tricky compiler/linker options or the function is static.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Is the result of PSTACK not NM&lt;BR /&gt;&lt;BR /&gt;U_STACK_TRACE(3) should also work.</description>
      <pubDate>Mon, 04 Jan 2010 18:49:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dladdr-returning-dynamic-as-function-name/m-p/4557750#M678940</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-01-04T18:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: dladdr returning _DYNAMIC as function name!</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/dladdr-returning-dynamic-as-function-name/m-p/4557751#M678941</link>
      <description>&lt;BR /&gt;Thanks Dennis :)&lt;BR /&gt;&lt;BR /&gt;That helped a lot :)&lt;BR /&gt;I managed to find one more function which works similar to dladdr() &lt;BR /&gt;&lt;BR /&gt;uwx_get_sym_info()&lt;BR /&gt;&lt;BR /&gt;This gave me the desired result.&lt;BR /&gt;&lt;BR /&gt;Regards :)&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Jan 2010 08:23:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/dladdr-returning-dynamic-as-function-name/m-p/4557751#M678941</guid>
      <dc:creator>Wkdunreal</dc:creator>
      <dc:date>2010-01-05T08:23:02Z</dc:date>
    </item>
  </channel>
</rss>

