title: Library choice according to $LD_LIBRARY_PATH and architecture
body: <p>For the demonstration I made 2 folders with 2 versions of libgcc_s.so.1
  And I looked for library choice according to ldd:</p>
  
  <pre><code>&gt; file {A,B}/libgcc_s.so.1
  A/libgcc_s.so.1: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), stripped
  B/libgcc_s.so.1: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), stripped
  
  &gt; LD_LIBRARY_PATH=A:B ldd MyProgram | grep libgcc_s.so.1
  libgcc_s.so.1 =&gt; B/libgcc_s.so.1
  </code></pre>
  
  <p>Why MyProgram does not use A/libgcc_s.so.1 ?
  I understand that is a matter of architecture but how A/libgcc_s.so.1 is considered invalid and how can I test it manually ?</p>