title: Does dlopen re-load already loaded dependencies? If so, what are the implications?
body: <p>I have a program, code-named <code>foo</code>. <code>foo</code> depends on <code>common.so</code> and is linked to it in the normal way (sorry I don't know the technical way to say that). When <code>foo</code> is running it then dynamically loads <code>bar.so</code> using <code>dlopen()</code>. So far so good.</p>
  
  <p>But, <code>bar.so</code> also depends on <code>common.so</code>. Will <code>dlopen()</code> re-load <code>common.so</code> (from what I've read it loads any required dependencies recursively), or will it detect that it is already loaded? If it does re-load it, could that cause problems in my program? Both <code>foo</code> and <code>bar.so</code> need to see the changes in <code>common.so</code> that either of them make to static variables there.</p>
  
  <p>Maybe my design needs to be changed or requires use of <code>-rdynamic</code> (which I also don't quite understand properly yet)?</p>