While there are comparable questions out there, I have not found a solution for this specific circumstance. And I admit that this particular question may be appropriate to only me; however, the question still stands in the general sense. Given a binary only, how do you determine which libraries it needs to run? The commands below are executing on:
chrisheady@linux:~/Dropbox$ uname -a
Linux linux 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
The file in question is "lmgrd." When I try to run the executable this is what I get:
chrisheady@linux:~/Dropbox$ ./lmgrd
bash: ./lmgrd: No such file or directory
I have tried to debug using a few easy Linux commands, such as:
chrisheady@linux:~/Dropbox$ ls -la lmgrd
-rwxrwxrwx 1 chrisheady chrisheady 1562496 Mar 1 2018 lmgrd
chrisheady@linux:~/Dropbox$ file lmgrd
lmgrd: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-lsb-x86-64.so.3, for GNU/Linux 2.6.18, stripped
chrisheady@linux:~/Dropbox$ ldd -v lmgrd
linux-vdso.so.1 (0x00007ffc5b779000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6f03ced000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6f0394f000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6f03737000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6f03346000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6f03142000)
/lib64/ld-lsb-x86-64.so.3 => /lib64/ld-linux-x86-64.so.2 (0x00007f6f03f0c000)
Version information:
./lmgrd:
libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2
libpthread.so.0 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libpthread.so.0
libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0
libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libpthread.so.0:
ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2
ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libm.so.6:
ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libgcc_s.so.1:
libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libc.so.6:
ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2
ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
/lib/x86_64-linux-gnu/libdl.so.2:
ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6
libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6
chrisheady@linux:~/Dropbox$ objdump -p lmgrd
lmgrd: file format elf64-x86-64
Program Header:
PHDR off 0x0000000000000040 vaddr 0x0000000000400040 paddr 0x0000000000400040 align 2**3
filesz 0x00000000000001c0 memsz 0x00000000000001c0 flags r-x
INTERP off 0x0000000000000200 vaddr 0x0000000000400200 paddr 0x0000000000400200 align 2**0
filesz 0x000000000000001a memsz 0x000000000000001a flags r--
LOAD off 0x0000000000000000 vaddr 0x0000000000400000 paddr 0x0000000000400000 align 2**21
filesz 0x000000000016fc04 memsz 0x000000000016fc04 flags r-x
LOAD off 0x0000000000170000 vaddr 0x0000000000770000 paddr 0x0000000000770000 align 2**21
filesz 0x000000000000c4e9 memsz 0x0000000000019448 flags rw-
DYNAMIC off 0x00000000001707a8 vaddr 0x00000000007707a8 paddr 0x00000000007707a8 align 2**3
filesz 0x00000000000001d0 memsz 0x00000000000001d0 flags rw-
NOTE off 0x000000000000021c vaddr 0x000000000040021c paddr 0x000000000040021c align 2**2
filesz 0x0000000000000020 memsz 0x0000000000000020 flags r--
EH_FRAME off 0x00000000001542c0 vaddr 0x00000000005542c0 paddr 0x00000000005542c0 align 2**2
filesz 0x0000000000005104 memsz 0x0000000000005104 flags r--
STACK off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
Dynamic Section:
NEEDED libpthread.so.0
NEEDED libm.so.6
NEEDED libgcc_s.so.1
NEEDED libc.so.6
NEEDED libdl.so.2
INIT 0x0000000000404470
FINI 0x00000000004d5ea4
HASH 0x0000000000400240
STRTAB 0x00000000004020f0
SYMTAB 0x0000000000400950
STRSZ 0x0000000000000988
SYMENT 0x0000000000000018
DEBUG 0x0000000000000000
PLTGOT 0x0000000000770b58
PLTRELSZ 0x0000000000001188
PLTREL 0x0000000000000007
JMPREL 0x00000000004032e8
RELA 0x0000000000402d00
RELASZ 0x00000000000005e8
RELAENT 0x0000000000000018
VERNEED 0x0000000000402c70
VERNEEDNUM 0x0000000000000003
VERSYM 0x0000000000402a78
Version References:
required from libdl.so.2:
0x09691a75 0x00 07 GLIBC_2.2.5
required from libpthread.so.0:
0x09691972 0x00 04 GLIBC_2.3.2
0x09691a75 0x00 03 GLIBC_2.2.5
required from libc.so.6:
0x0d696913 0x00 06 GLIBC_2.3
0x09691974 0x00 05 GLIBC_2.3.4
0x09691a75 0x00 02 GLIBC_2.2.5
I attempted ln -s /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3
followed by ldconfig -n /lib64
but when I execute lmgrd
, I still get the same error.
~/Dropbox
- are you actually working in a Dropbox folder? if so I wonder if the issue might not be related to library linkage at all?ldd lmgrd
, which you suggested in your question, answers the question you've asked.ldd
lists the libraries required to run the application.ldconfig
. But you do realise you've linked two different libraries together, don't you (ld-linux
vsld-lsb
).ldconfig -n /lib64
then tryinglmgrd
again, fails with the same error.