2
It appears that I can run both ELF 32-bit and ELF 64-bit binaries on my Linux host. I am running on pretty vanilla Linux boxes (Intel hardware, RedHat 64-bit kernel, etc.)
- How is that possible?
- Is there a test to know this is possible on each Linux installation (certain library, kernel module, etc.)?
Some helpful details:
$ uname -a
Linux xhkg6002dap 2.6.18-348.4.1.el5 #1 SMP Fri Mar 22 05:41:51 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
To me, that looks like I am runing an x86 Linux kernel that is 64-bit.
We have several versions of Subversion installed. Some appear to be 32-bit and others 64-bit. I can run at least some 32-bit versions and some 64-bit versions.
$ for file in $(find /sbcimp/run/pd/subversion -path '*/bin/svn') ; do echo $file ; file $file ; $file --version 2>&1 | head -n 1 ; done
/sbcimp/run/pd/subversion/1.5.3/bin/svn
/sbcimp/run/pd/subversion/1.5.3/bin/svn: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
svn, version 1.5.3 (r33570)
/sbcimp/run/pd/subversion/64-bit/1.5.3/bin/svn
/sbcimp/run/pd/subversion/64-bit/1.5.3/bin/svn: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
svn, version 1.5.3 (r33570)
/sbcimp/run/pd/subversion/64-bit/1.5.4/bin/svn
/sbcimp/run/pd/subversion/64-bit/1.5.4/bin/svn: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
svn, version 1.5.4 (r33841)
/sbcimp/run/pd/subversion/64-bit/1.6.2/bin/svn
/sbcimp/run/pd/subversion/64-bit/1.6.2/bin/svn: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
/sbcimp/run/pd/subversion/64-bit/1.6.2/bin/svn: error while loading shared libraries: libssl.so.0.9.8: cannot open shared object file: No such file or directory
/sbcimp/run/pd/subversion/64-bit/1.6.6/bin/svn
/sbcimp/run/pd/subversion/64-bit/1.6.6/bin/svn: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
/sbcimp/run/pd/subversion/64-bit/1.6.6/bin/svn: error while loading shared libraries: libssl.so.0.9.8: cannot open shared object file: No such file or directory
/sbcimp/run/pd/subversion/1.5.4/bin/svn
/sbcimp/run/pd/subversion/1.5.4/bin/svn: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
svn, version 1.5.4 (r33841)
/sbcimp/run/pd/subversion/1.6.2/bin/svn
/sbcimp/run/pd/subversion/1.6.2/bin/svn: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
svn, version 1.6.2 (r37639)
/sbcimp/run/pd/subversion/1.6.6/bin/svn
/sbcimp/run/pd/subversion/1.6.6/bin/svn: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
svn, version 1.6.6 (r40053)
Does running 32bit code still require 32bit libraries to be installed. I had an instance of Ubuntu Server x64 (don't remember what version) running and had to download the 32 bit libraries. Everything existed as duplicates. – Fiasco Labs – 2014-02-04T05:03:44.390
Usually a 32bit app requires 32 bit libraries. In many cases the 64 bit libraries are optimized to take advantage of 64 bits and 32 bit programs can have issues. For example if a 32bit program was handed a 64 bit memory address it couldn't handle it. – cybernard – 2014-02-04T05:12:54.520