title: nm reports symbol is defined but ldd reports symbol is undefined
body: <p>I'm having a linking problem.  I need to link against a shared library <code>libfoo.so</code> that depends on a function <code>read</code> which I would like to define myself in the file read.c.</p>
  
  <p>I compile and link everything together but at runtime I get the error</p>
  
  <pre><code>/home/bar/src/libfoo.so: undefined symbol: sread.
  </code></pre>
  
  <p>nm reports the symbol is defined </p>
  
  <pre><code>$nm baz | grep sread
    00000000000022f8 t sread
  </code></pre>
  
  <p>but ldd reports the symbol is undefined </p>
  
  <pre><code>$ldd -r baz | grep sread 
  undefined symbol: sread (/home/bar/src/libfoo.so)
  </code></pre>
  
  <p>What gives? Is there some isse with the fact that libfoo.so is a shared library?</p>