Difference between revisions of "Replacement for command ldd on Linux"
From KoanSoftware Wiki
Line 40: | Line 40: | ||
root@intel-corei7-64:~# aarch64-poky-linux-objdump -x nInvaders | grep NEEDED | root@intel-corei7-64:~# aarch64-poky-linux-objdump -x nInvaders | grep NEEDED | ||
− | + | ||
NEEDED libncurses.so.5 | NEEDED libncurses.so.5 | ||
NEEDED libtinfo.so.5 | NEEDED libtinfo.so.5 | ||
NEEDED libc.so.6 | NEEDED libc.so.6 | ||
NEEDED ld-linux-aarch64.so.1 | NEEDED ld-linux-aarch64.so.1 |
Latest revision as of 10:32, 28 February 2025
Replacement for command ldd on Linux
Are you looking to install the ldd command on your Linux system but it isn't available?
This is typical when you are using Yocto Project on the target board.
Alternative Method to Check Library Dependencies in Linux While the ldd command is a powerful tool for examining library dependencies, there are alternative methods that can provide similar information. One such method is using the objdump command.
# LD_TRACE_LOADED_OBJECTS=1 /lib/ld-linux-armhf.so.3 /usr/bin/gpg linux-vdso.so.1 (0xbef3e000) libz.so.1 => /lib/libz.so.1 (0xb6f70000) libbz2.so.1 => /usr/lib/libbz2.so.1 (0xb6f50000) libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0xb6ea0000) libreadline.so.8 => /usr/lib/libreadline.so.8 (0xb6e50000) libassuan.so.0 => /usr/lib/libassuan.so.0 (0xb6e30000) libnpth.so.0 => /usr/lib/libnpth.so.0 (0xb6e10000) libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0xb6de0000) libc.so.6 => /lib/libc.so.6 (0xb6cc0000) libcap.so.2 => /lib/libcap.so.2 (0xb6ca0000) libtinfo.so.5 => /lib/libtinfo.so.5 (0xb6c70000) /lib/ld-linux-armhf.so.3 (0xb6f98000)
or
root@intel-corei7-64:~# LD_TRACE_LOADED_OBJECTS=1 /lib/ld-linux-x86-64.so.2 /usr/bin/aplay linux-vdso.so.1 (0x00007ffc005c6000) libasound.so.2 => /usr/lib/libasound.so.2 (0x00007f0a498fe000) libc.so.6 => /lib/libc.so.6 (0x00007f0a496fe000) libm.so.6 => /lib/libm.so.6 (0x00007f0a49620000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007f0a4961b000) librt.so.1 => /lib/librt.so.1 (0x00007f0a49616000) /lib/ld-linux-x86-64.so.2 (0x00007f0a49a23000)
or using the cross compiler objdump command
root@intel-corei7-64:~# aarch64-poky-linux-objdump -x nInvaders | grep NEEDED NEEDED libncurses.so.5 NEEDED libtinfo.so.5 NEEDED libc.so.6 NEEDED ld-linux-aarch64.so.1