title: Linking two shared libraries with some of the same symbols
body: <p>I link with two different shared libraries. Both libraries define some symbols that share a name but have different implementations. I can't make each library use its own implementation over the other.</p>
  
  <p>For example, both libraries define a global function <code>bar()</code> that each calls internally. Library one calls it from <code>foo1()</code> and library two calls it from <code>foo2()</code>.</p>
  
  <p>Lib1.so:</p>
  
  <pre><code>T bar
  T foo1()     // calls bar()
  </code></pre>
  
  <p>Lib2.so:</p>
  
  <pre><code>T bar
  T foo2()     // calls bar()
  </code></pre>
  
  <p>If I link my application against Lib1.so and then Lib2.so the bar implementation from Lib1.so is called even when calling <code>foo2()</code>. If on the other hand, I link my application against Lib2.so and then Lib1.so, then bar is always called from Lib2.so.</p>
  
  <p>Is there a way to make a library always prefer its own implementation above any other library?</p>