ld-linux.so.2 bad elf interpreter

Posted in doh

Death by Dynamically linked libraries.

If you’re trying to run some binary and you’re getting errors about bad elf interpreter, you’re probably trying to run something compiled for 64 bit on a 32 bit machine, vice versa, or maybe ARM or ppc, etc.

The binary file was compiled with the dependency of one or more shared libraries. The libraries needed by the application you’re trying to execute are not included in the binary itself, they have to reside on your system.

chain-link

When you execute a binary, somegui for example, ld-linux.so is the dynamic linker, and attempts to resolve the dependencies of somegui before passing control to somegui.

You can see which shared libraries a given binary is dependent on using ldd.

# ldd somegui
linux-gate.so.1 => (0×00110000)
libaudiofile.so.0 => /usr/lib/libaudiofile.so.0 (0×008aa000)
libesd.so.0 => /usr/lib/libesd.so.0 (0×008d7000)
libgnomesupport.so.0 => /usr/lib/libgnomesupport.so.0 (0×001e6000)
libgnome.so.32 => /usr/lib/libgnome.so.32 (0×001c9000)
libICE.so.6 => /usr/lib/libICE.so.6 (0×0716d000)
libSM.so.6 => /usr/lib/libSM.so.6 (0×07189000)
libgdk_imlib.so.1 => /usr/lib/libgdk_imlib.so.1 (0×00259000)
libart_lgpl.so.2 => /usr/lib/libart_lgpl.so.2 (0×0042f000)
libgnomeui.so.32 => /usr/lib/libgnomeui.so.32 (0×00441000)
libX11.so.6 => /usr/lib/libX11.so.6 (0×068ed000)
libXext.so.6 => /usr/lib/libXext.so.6 (0×069eb000)
libXi.so.6 => /usr/lib/libXi.so.6 (0×06b0e000)
libdl.so.2 => /lib/libdl.so.2 (0×00dcf000)
libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0×0019d000)

These libraries need to be installed in these locations on your system. If they’re not found or they don’t match version or architecture, game over.

ELF interpreter /lib/ld-linux.so.2 not found

If you’re using FreeBSD or OpenBSD and see this message, you’re probably trying to run something built for Linux, but the BSD’s have their own C libraries, so this might be tricky. You could try QEMU to emulate the environment, but then you’re running it under Linux. There’s also the glibc freebsd port, but I think they only support limited architectures. Head over to the #gnu-kbsd channel on Freenode for more help.

Posted by admica   @   8 February 2010

Related Posts

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« SSH Captchas and Man In The Middle Attacks
Next Post
Apple ipad is nothing more than mobile itunes »
Powered by Wordpress   |   Lunated designed by ZenVerse