비슷한 질문이 있지만 이 특정 상황에 대한 해결책을 찾지 못했습니다. 나는 이 특별한 질문이 나에게만 적용될 수 있다는 것을 인정합니다. 그러나 그 질문은 여전히 일반적인 의미로 존재합니다. 바이너리만 주어지면 실행해야 할 라이브러리를 어떻게 결정합니까? 다음 명령이 실행되고 있습니다.
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
문제의 파일은 "lmgrd"입니다. 실행 파일을 실행하려고 하면 다음과 같은 결과가 나타납니다.
chrisheady@linux:~/Dropbox$ ./lmgrd
bash: ./lmgrd: No such file or directory
다음과 같은 간단한 Linux 명령을 사용하여 디버깅을 시도했습니다.
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
ln -s /lib64/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3
따라 해 보았지만 ldconfig -n /lib64
실행해도 lmgrd
여전히 같은 오류가 발생합니다.
답변1
lmgrd
이 특정 라이브러리를 얻으려면 LSB(Linux Standard Library)가 있어야 합니다. 설치하면 작동합니다. (설명하다, apt install lsb
.)