For the demonstration I made 2 folders with 2 versions of libgcc_s.so.1 And I looked for library choice according to ldd:
> 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
> LD_LIBRARY_PATH=A:B ldd MyProgram | grep libgcc_s.so.1
libgcc_s.so.1 => B/libgcc_s.so.1
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 ?