Running ELF 32-bit LSB executable on RasberryPi

Viewed 110

I am trying to run this executable:

file /home/tk/app
/home/tk/app: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, with debug_info, not stripped

It does not work as a shared library is missing:

ldd /home/tk/app
        linux-vdso.so.1 (0x7eea2000)
        /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0x76f35000)
        libsqlite3.so.0 => /lib/arm-linux-gnueabihf/libsqlite3.so.0 (0x76df6000)
        libmosquitto.so.1 => /lib/arm-linux-gnueabihf/libmosquitto.so.1 (0x76dd1000)
        libc.so.0 => not found
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76c7d000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76c0e000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76be2000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76bce000)
        /lib/ld-uClibc.so.0 => /lib/ld-linux-armhf.so.3 (0x76f4a000)
        libssl.so.1.1 => /lib/arm-linux-gnueabihf/libssl.so.1.1 (0x76b4e000)
        libcrypto.so.1.1 => /lib/arm-linux-gnueabihf/libcrypto.so.1.1 (0x7692e000)

I found some possible solutions installing uClibc-ng, but I run into multiple compilation issues. Is it even possible to run this binary on this platform?

uname -a Linux raspberrypi 5.15.32-v7+ #1538 SMP Thu Mar 31 19:38:48 BST 2022 armv7l GNU/Linux

Thanks :-) Tobi

EDIT I just linked libc.so.0 to /lib/ld-linux-armhf.so.3:

ldd app
        linux-vdso.so.1 (0x7eda3000)
        /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0x76f32000)
        libsqlite3.so.0 => /lib/arm-linux-gnueabihf/libsqlite3.so.0 (0x76df3000)
        libmosquitto.so.1 => /lib/arm-linux-gnueabihf/libmosquitto.so.1 (0x76dce000)
        libc.so.0 => /lib/libc.so.0 (0x76d9a000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76c46000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76bd7000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76bab000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76b97000)
        /lib/ld-uClibc.so.0 => /lib/ld-linux-armhf.so.3 (0x76f47000)
        libssl.so.1.1 => /lib/arm-linux-gnueabihf/libssl.so.1.1 (0x76b17000)
        libcrypto.so.1.1 => /lib/arm-linux-gnueabihf/libcrypto.so.1.1 (0x768f7000)

But it still does not run: strace: Can't stat 'app': command not found

As the interpreter is /lib/ld-uClibc.so.0, is there any way to run it on Raspberry?

objdump -j .interp -s app

app:     file format elf32-littlearm

Contents of section .interp:
 10134 2f6c6962 2f6c642d 75436c69 62632e73  /lib/ld-uClibc.s
 10144 6f2e3000                             o.0.
0 Answers
Related