title: how to linking with dynamic lib (.so) and static libc.a
body: <p>I'm trying to link with the static libc.a and a dynamic lib .so unsuccessfully.</p>
  
  <p>I've already tryied the following:</p>
  
  <ol>
  <li><p>Firstly I test with all dynamic:</p>
  
  <ul>
  <li>gcc -shared libtest.c -o libtest.so</li>
  <li>gcc -c main.c -o main.o</li>
  <li>gcc main.o -o test -L. -ltest</li>
  </ul>
  
  <p>It's working (compile and execute)</p></li>
  <li><p>Secondly I test what I want (dynamic lib and static libc) :</p>
  
  <ul>
  <li>gcc -shared libtest.c -o libtest.so</li>
  <li>gcc -c main.c -o main.o</li>
  <li>gcc main.o -o test libtest.so /usr/lib/libc.a</li>
  </ul>
  
  <p>It's compiling, but at execution, it segfault!
  A strace show that it's trying to access libc.so!!!</p></li>
  <li><p>Finally I've tried to compile a simple progam with no reference to dynamic lib</p>
  
  <ul>
  <li>gcc -static main.c  --> compile ok, run ok</li>
  <li>gcc main.c  /usr/lib/libc.a --> compile ok, run : segmentation fault (a strace show that it's access to libc.so)</li>
  </ul></li>
  </ol>
  
  <p>How to do that?</p>
  
  <p>Thank you</p>