title: dlopen in libc and libdl
body: <p>If a gcc-compiled program is calling dlopen, it has to be compiled with the -ldl option enabled. This means that such a program relies at run time on the library libdl.so. In fact by doing ldd on it we see the line:</p>
  
  <pre><code>libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2
  </code></pre>
  
  <p>libc.so in turn uses dlopen (e.g., to deal with libnss.so), but doing ldd on  libldl.so doesn't appear:</p>
  
  <pre><code>/lib64/ld-linux-x86-64.so.2 (0x00007f5a488e4000)
  linux-vdso.so.1 =&gt;  (0x00007fff7bdfe000)
  </code></pre>
  
  <p>Why this difference?</p>