Emulating an AARCH64 Binary calling libgps on x86_64 Ubuntu using QEMU gives "Error relocating: symbol not found" Errors
0
votes
1
answer
1364
views
This is similar to the issue posted here and here . I want to reverse engineer a binary called **gpslogger** but before debugging it using GDB, I wish to simply emulate it using QEMU (qemu-aarch64) since when I run
file gpslogger
I get gpslogger: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, not stripped
. I start by downloading the exact interpreter file and pasting it in my Ubuntu 16.04 x86_64 /lib
folder and then other errors show up asking for other .so
files, e.g., libgps.so
. I then download those .so
files for the AARCH64 architecture and paste them in the /lib
folder of my Ubuntu. Once all the .so
errors, i.e., no such file or directory
are gone, I'm left with
Error relocating /lib/libgps.so: __strdup: symbol not found
Error relocating /lib/libgps.so: __fdelt_chk: symbol not found
Error relocating /lib/libgps.so: __fprintf_chk: symbol not found
Error relocating /lib/libgps.so: __snprintf_chk: symbol not found
Error relocating /lib/libgps.so: __isnan: symbol not found
Error relocating /lib/libgps.so: __syslog_chk: symbol not found
Error relocating /lib/libgps.so: __vsnprintf_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __snprintf_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __vsnprintf_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __strncpy_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __vfprintf_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __fprintf_chk: symbol not found
Error relocating /lib/libdbus-1.so.3: __vsprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __sprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: reallocarray: symbol not found
Error relocating /lib/libsystemd.so.0: __register_atfork: symbol not found
Error relocating /lib/libsystemd.so.0: __memcpy_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __snprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __vsnprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __strncpy_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __vasprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __open64_2: symbol not found
Error relocating /lib/libsystemd.so.0: __asprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __fprintf_chk: symbol not found
Error relocating /lib/libsystemd.so.0: __ppoll_chk: symbol not found
Error relocating /lib/libsystemd.so.0: fcntl64: symbol not found
Error relocating /lib/libsystemd.so.0: __explicit_bzero_chk: symbol not found
Error relocating /lib/libsystemd.so.0: parse_printf_format: symbol not found
Error relocating /lib/libsystemd.so.0: __openat64_2: symbol not found
Error relocating /lib/libgcrypt.so.20: __memcpy_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __snprintf_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __fdelt_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __vfprintf_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __memset_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __fprintf_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __read_chk: symbol not found
Error relocating /lib/libgcrypt.so.20: __syslog_chk: symbol not found
Error relocating /lib/libgpg-error.so.0: __sprintf_chk: symbol not found
Error relocating /lib/libgpg-error.so.0: __fdelt_chk: symbol not found
Error relocating /lib/libgpg-error.so.0: __vfprintf_chk: symbol not found
Error relocating /lib/libgpg-error.so.0: __memset_chk: symbol not found
Error relocating /lib/libgpg-error.so.0: __fprintf_chk: symbol not found
Error relocating gpslogger: GPSNMEA: symbol not found
Except for the last relocation error, I believe all the other functions should be implemented in glibc
. Therefore, I simply downloaded the libc-2.32.so
file from here for the AARCH64 architecture and pasted it in the /lib
folder of my Ubuntu. However, the errors didn't go away. Please let me know if more information is needed. I appreciate any help on the issue.
**Edit:**
readelf -d gpslogger | grep 'NEEDED'
returns:
0x0000000000000001 (NEEDED) Shared library: [libgps.so]
0x0000000000000001 (NEEDED) Shared library: [libc.musl-aarch64.so.1]
Does this mean that the libc
is coming from musl
and is not glibc
?
Asked by Newbie
(135 rep)
Nov 26, 2020, 06:03 PM
Last activity: Dec 27, 2020, 12:24 AM
Last activity: Dec 27, 2020, 12:24 AM