<?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 LD_PRELOAD unresolved symbols in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998802#M98045</link>
    <description>&lt;!--!*#--&gt;I am trying to patch the Boehm garbage collector to override malloc etc. using LD_PRELOAD on an HPUX 11.0 PARISC machine and running into some trouble.&lt;BR /&gt;&lt;BR /&gt;Here is what happens:&lt;BR /&gt;&lt;BR /&gt;# LD_PRELOAD=/home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2 date&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __data_start (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: end (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: GC_dirty_maintained (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: GC_n_kinds (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: GC_root_size (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: GC_time_limit (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: GC_is_initialized (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: malloc (code)  from /usr/lib/libpthread.1&lt;BR /&gt;Abort(coredump)&lt;BR /&gt;# &lt;BR /&gt;&lt;BR /&gt;The first two symbols are special and I assume may need some porting work on my part.  However, the others are in the library:&lt;BR /&gt;&lt;BR /&gt;# odump -slexport $PR/tmp/gc6.4.redirect/.libs/libgc.sl.1.2 | grepword 'GC_dirty_maintained|GC_n_kinds|GC_root_size|GC_time_limit|GC_is_initialized|malloc'&lt;BR /&gt;000000074 -00000001  00001 0x40004270  Data  000000,155  00 GC_time_limit&lt;BR /&gt;000000077 -00000001  00015 0x400045f4  Data  000000,155  00 GC_is_initialized&lt;BR /&gt;000000080 -00000001  00014 0x40004404  Data  000000,155  00 GC_root_size&lt;BR /&gt;000000085 000000009  00018 0x40004644  Data  000000,155  00 GC_dirty_maintained&lt;BR /&gt;000000132 -00000001  00013 0x400043d4  Data  000000,155  00 GC_n_kinds&lt;BR /&gt;000000417 -00000001  00011 0x0001d9f4  Code  000000,155  00 malloc&lt;BR /&gt;&lt;BR /&gt;Can anyone shed some light on this?&lt;BR /&gt;&lt;BR /&gt;Joe Buehler</description>
    <pubDate>Tue, 22 Aug 2006 07:02:42 GMT</pubDate>
    <dc:creator>Joseph H. Buehler</dc:creator>
    <dc:date>2006-08-22T07:02:42Z</dc:date>
    <item>
      <title>LD_PRELOAD unresolved symbols</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998802#M98045</link>
      <description>&lt;!--!*#--&gt;I am trying to patch the Boehm garbage collector to override malloc etc. using LD_PRELOAD on an HPUX 11.0 PARISC machine and running into some trouble.&lt;BR /&gt;&lt;BR /&gt;Here is what happens:&lt;BR /&gt;&lt;BR /&gt;# LD_PRELOAD=/home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2 date&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __data_start (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: end (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: GC_dirty_maintained (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: GC_n_kinds (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: GC_root_size (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: GC_time_limit (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: GC_is_initialized (data)  from /home/project-releases/tmp/gc6.4.redirect/.libs/libgc.sl.1.2&lt;BR /&gt;/usr/lib/dld.sl: Unresolved module for symbol: malloc (code)  from /usr/lib/libpthread.1&lt;BR /&gt;Abort(coredump)&lt;BR /&gt;# &lt;BR /&gt;&lt;BR /&gt;The first two symbols are special and I assume may need some porting work on my part.  However, the others are in the library:&lt;BR /&gt;&lt;BR /&gt;# odump -slexport $PR/tmp/gc6.4.redirect/.libs/libgc.sl.1.2 | grepword 'GC_dirty_maintained|GC_n_kinds|GC_root_size|GC_time_limit|GC_is_initialized|malloc'&lt;BR /&gt;000000074 -00000001  00001 0x40004270  Data  000000,155  00 GC_time_limit&lt;BR /&gt;000000077 -00000001  00015 0x400045f4  Data  000000,155  00 GC_is_initialized&lt;BR /&gt;000000080 -00000001  00014 0x40004404  Data  000000,155  00 GC_root_size&lt;BR /&gt;000000085 000000009  00018 0x40004644  Data  000000,155  00 GC_dirty_maintained&lt;BR /&gt;000000132 -00000001  00013 0x400043d4  Data  000000,155  00 GC_n_kinds&lt;BR /&gt;000000417 -00000001  00011 0x0001d9f4  Code  000000,155  00 malloc&lt;BR /&gt;&lt;BR /&gt;Can anyone shed some light on this?&lt;BR /&gt;&lt;BR /&gt;Joe Buehler</description>
      <pubDate>Tue, 22 Aug 2006 07:02:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998802#M98045</guid>
      <dc:creator>Joseph H. Buehler</dc:creator>
      <dc:date>2006-08-22T07:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: LD_PRELOAD unresolved symbols</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998803#M98046</link>
      <description>First problem, the "date" binary does not have SHLIB_PATH enabled.&lt;BR /&gt;&lt;BR /&gt;Second problem, there is some bizarreness in the way that SHLIB_PATH and/or LD_PRELOAD need to be set.&lt;BR /&gt;&lt;BR /&gt;The following works:&lt;BR /&gt;&lt;BR /&gt;env SHLIB_PATH=/the/dir/with/libgc.sl LD_PRELOAD=libgc.sl test_binary.exe&lt;BR /&gt;&lt;BR /&gt;I found that exporting the two environment variables in a subshell does NOT work for whatever reason:&lt;BR /&gt;&lt;BR /&gt;(export SHLIB_PATH=whatever; export LD_PRELOAD=whatever; test_binary.exe)&lt;BR /&gt;&lt;BR /&gt;that just results in a memory fault...&lt;BR /&gt;&lt;BR /&gt;Joe Buehler</description>
      <pubDate>Tue, 22 Aug 2006 07:46:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998803#M98046</guid>
      <dc:creator>Joseph H. Buehler</dc:creator>
      <dc:date>2006-08-22T07:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: LD_PRELOAD unresolved symbols</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998804#M98047</link>
      <description>List dynamic dependencies with ldd -v and chatr.&lt;BR /&gt;&lt;BR /&gt;Verify patch dependencies or linking to dynamic libraries in /usr/lib options in $SHLIB_PATH.&lt;BR /&gt;&lt;BR /&gt;echo $SHLIB_PATH</description>
      <pubDate>Tue, 22 Aug 2006 08:03:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998804#M98047</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2006-08-22T08:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: LD_PRELOAD unresolved symbols</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998805#M98048</link>
      <description>&amp;gt;I am trying to patch the Boehm garbage collector to override malloc etc. using LD_PRELOAD &lt;BR /&gt;&lt;BR /&gt;LD_PRELOAD is very dangerous.  It would be better if you just link your application with that new GC.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;The first two symbols are special and I assume may need some porting work on my part.&lt;BR /&gt;&lt;BR /&gt;These are the problem.  You look at "Unresolved symbol" for the missing ones and the "Unresolved module" are the reason.  So to fix the issue you need to relink your application with -Wl,+ee,__data_start -Wl,+ee,end.&lt;BR /&gt;&lt;BR /&gt;But if you could do that, you might as well link with libgc.sl.1.2.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Joseph:  I found that exporting the two environment variables in a subshell does NOT work&lt;BR /&gt;&lt;BR /&gt;Right, you never want to export that variable, only use it sparingly as possible.  And you may want to consider LD_PRELOAD_ONCE if you have the appropriate patches.&lt;BR /&gt;&lt;BR /&gt;Also SHLIB_PATH is not needed if you give the absolute path for LD_PRELOAD, unless there are dependent libs.</description>
      <pubDate>Tue, 22 Aug 2006 20:06:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998805#M98048</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-08-22T20:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: LD_PRELOAD unresolved symbols</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998806#M98049</link>
      <description>Thanks Dennis -- I got it working but I need to experiment a little with various combinations of SHLIB_PATH, LD_PRELOAD and "chatr +s enable".&lt;BR /&gt;&lt;BR /&gt;It's easier to link against libgc.sl of course, but much nicer to be able to use LD_PRELOAD on an arbitrary application to temporarily fix customer-discovered memory leaks.</description>
      <pubDate>Wed, 23 Aug 2006 12:33:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ld-preload-unresolved-symbols/m-p/4998806#M98049</guid>
      <dc:creator>Joseph H. Buehler</dc:creator>
      <dc:date>2006-08-23T12:33:41Z</dc:date>
    </item>
  </channel>
</rss>

