title: hidden symbol `stat' in libc_nonshared.a(stat.oS) is referenced by DSO
body: <p>I'm trying to use methods contained in a shared library (<code>libscplugin.so</code>).</p>
  
  <p>I have satisfied all of the libraries requirements:</p>
  
  <ul>
  <li><code>libc.so</code> with a symlink to <code>libc.so.6</code></li>
  <li><code>libz.so</code> with a symlink to <code>libz.so.1.2.8</code></li>
  <li><code>libstdc++.so</code> with a symlink to <code>libstdc++.so.6.0.20</code></li>
  </ul>
  
  <p>Upon compilation I get the following error message:</p>
  
  <pre><code>$ gcc test.c -o test -L/usr/lib/arm-linux-gnueabihf/ -lscplugin
  /usr/bin/ld: test: hidden symbol `stat' in /usr/lib/arm-linux-gnueabihf/libc_nonshared.a(stat.oS) is referenced by DSO
  /usr/bin/ld: final link failed: Bad value
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>The only reference I could find to <code>libc_nonshared.a</code> is in <code>/usr/lib/arm-linux-gnueabihf/libc.so</code>:</p>
  
  <pre><code>$ cat libc.so
  /* GNU ld script
     Use the shared library, but some functions are only in
     the static library, so try that secondarily.  */
  OUTPUT_FORMAT(elf32-littlearm)
  GROUP ( /lib/arm-linux-gnueabihf/libc.so.6 /usr/lib/arm-linux-gnueabihf/libc_nonshared.a  AS_NEEDED ( /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 ) )
  </code></pre>
  
  <p>In <code>test.c</code> I'm attempting to use two functions of the shared library (totally unrelated to <code>stat</code>). What can I do to get this to compile ?</p>