0

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
  • Puzzled. What's wrong with ldd lmgrd, which you've included in your question? – roaima Jan 30 at 13:52
  • Sorry, @roaima, I don't understand what you're asking me. There may not be anything wrong with ldd lmgrd; however, I included the information as it may be helpful for somebody who knows how to debug the problem with executing lmgrd. If you can provide some additional context for your question, that may be helpful. – Chris Heady Jan 30 at 14:08
  • I notice your shell prompt appears to show the PWD as ~/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? – steeldriver Jan 30 at 14:38
  • My puzzlement is because ldd lmgrd, which you suggested in your question, answers the question you've asked. ldd lists the libraries required to run the application. – roaima Jan 30 at 14:49
  • @roaima The only file I couldn't locate was ld-lsb-x86-64.so.3. So I created a symbolic link, i.e., "ln -s /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3". However, same problem, no such file or directory. – Chris Heady Jan 30 at 15:19
0

lmgrd requires the LSB (Linux Standard Base) to be present, in order to get that specific library. Install that, and it should work. (Say, apt install lsb.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.