基本用法是一樣的:
mklibs從符號對文件進行分析,mklibs-copy啥都不說把找到的都直接給放上去了。還有個mklibs-readelf用來打印ELF文件相關信息的,下面是相關的說明:
Usage: mklibs-readelf [OPTION]... FILE...
Prints informations about ELF shared objects and executables.
Mandatory arguments to long options are mandatory for short options too.
-i, --print-interp Print interpreter of executable
-n, --print-needed Print needed shared libs
-R, --print-rpath Print rpath setting
-s, --print-soname Print soname of shared object
-p, --print-symbols-provided Print provided symbols
-u, --print-symbols-undefined Print undefined symbols
--help Display this help and exit
--version Output version information and exit
下面是兩個例子:
mklibs
I: Using ld-linux.so.2 as dynamic linker.
I: library reduction pass 1
7 symbols, 7 unresolved
I: library reduction pass 2
285 symbols, 16 unresolved
I: library reduction pass 3
285 symbols, 3 unresolved
I: library reduction pass 4
285 symbols, 3 unresolved
stlxv@stlxvcomputer:~$ ls -lh tmp/
總用量 2.3M
-rwxr-xr-x 1 stlxv stlxv 107K 2007-07-19 20:31 ld-linux.so.2
-rw-r--r-- 1 stlxv stlxv 22K 2007-07-19 20:31 libcrypt.so.1
-rw-r--r-- 1 stlxv stlxv 1.2M 2007-07-19 20:31 libc.so.6
-rw-r--r-- 1 stlxv stlxv 9.5K 2007-07-19 20:31 libdl.so.2
-rw-r--r-- 1 stlxv stlxv 146K 2007-07-19 20:31 libm.so.6
-rw-r--r-- 1 stlxv stlxv 79K 2007-07-19 20:31 libpthread.so.0
-rw-r--r-- 1 stlxv stlxv 762K 2007-07-19 20:31 libruby1.8.so.1.8
stlxv@stlxvcomputer:~$ ldd /usr/bin/ruby
linux-gate.so.1 => (0xffffe000)
libruby1.8.so.1.8 => /usr/lib/libruby1.8.so.1.8 (0xb7e04000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7ded000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7de8000)
libcrypt.so.1 => /lib/tls/i686/cmov/libcrypt.so.1 (0xb7dba000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7d93000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7c52000)
/lib/ld-linux.so.2 (0xb7eee000)
stlxv@stlxvcomputer:~$ ls -lh tmp/
總用量 2.4M
-rwxr-xr-x 1 stlxv stlxv 107K 2007-07-19 20:33 ld-linux.so.2
-rw-r--r-- 1 stlxv stlxv 22K 2007-07-19 20:33 libcrypt.so.1
-rwxr-xr-x 1 stlxv stlxv 1.2M 2007-07-19 20:33 libc.so.6
-rw-r--r-- 1 stlxv stlxv 9.5K 2007-07-19 20:33 libdl.so.2
-rw-r--r-- 1 stlxv stlxv 146K 2007-07-19 20:33 libm.so.6
-rwxr-xr-x 1 stlxv stlxv 106K 2007-07-19 20:33 libpthread.so.0
-rw-r--r-- 1 stlxv stlxv 762K 2007-07-19 20:33 libruby1.8.so.1.8
stlxv@stlxvcomputer:~$ mklibs-readelf -n /usr/bin/ruby
libruby1.8.so.1.8
libpthread.so.0
libdl.so.2
libcrypt.so.1
libm.so.6
libc.so.6