title: gcc -static: link statically only one specified library
body: <p>I have compiled my program linked dynamically:</p>
  
  <pre><code>gcc -s -o foo foo.c -lcrypto
  </code></pre>
  
  <p>It is linked with following libraries:</p>
  
  <pre><code>linux-vdso.so.1 =&gt;  (0x00007fff0bff5000)
  libcrypto.so.1.0.0 =&gt; /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fd68431c000)
  libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd683f91000)
  libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd683d8c000)
  libz.so.1 =&gt; /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd683b75000)
  /lib64/ld-linux-x86-64.so.2 (0x00007fd68471c000)
  </code></pre>
  
  <p>Now I need to run it on a system, which is missing only one of the linked libraries (<code>libcrypto.so.1.0.0</code>).</p>
  
  <p>I can compile my code as statically linked:</p>
  
  <pre><code>gcc -static -s -o foo foo.c -lcrypto
  </code></pre>
  
  <p>But the resulting binary is too large, apparently because it links all libraries statically.</p>
  
  <p><strong>Can I link statically only one library (<code>libcrypto.so.1.0.0</code>), and leave the others linked dynamically ?</strong></p>