title: correct linking order with ifort and .so libraries
body: <p>I have two 3rd party libraries A.so and B.so that I am linking together with my executable executable.exe. A.so contains a bug that is addressed by B.so, that is, say:</p>
  
  <ul>
  <li><code>A::subroutine1()</code> may crash with a floating point exception when called (FP arithmetic bug)</li>
  <li><code>B::subroutine1()</code> is a fixed implementation that should always be called instead of <code>A::subroutine1()</code>.</li>
  </ul>
  
  <p>What is the correct linking order for A and B? What I am doing now is:</p>
  
  <pre><code>ifort &lt;....&gt; executable.exe &lt;...&gt; -lA -lB
  </code></pre>
  
  <p>I am still getting the floating point exception from time to time (the error is not reproducible exactly, so it's pretty difficult to debug). However, when it crashes, the program lets me know that A::subroutine1() is the offender - so the wrong version of subroutine1() gets linked in for some reason. </p>
  
  <p>I will flip the linking order as a 1st stab at this, but is there a tool that I can use to inspect executable.exe to see what version of subroutine1() will be called at runtime?</p>
  
  <p>thanks!</p>