ライブラリが参照しているファイルのパスを調べるには

Facebooktwittergoogle_plustumblrmail
ライブラリを使うプログラムを strace で追跡する。
$ strace valgrind
execve("/opt/valgrind/bin/valgrind", ["valgrind"], [/* 20 vars */]) = 0
brk(0) = 0x14000
uname({sys="Linux", node="beagleboard101", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40016000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("tls/v7l/neon/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("tls/v7l/neon/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("tls/v7l/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("tls/v7l/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("tls/neon/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("tls/neon/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("tls/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("v7l/neon/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("v7l/neon/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("v7l/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("v7l/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("neon/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("neon/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/tls/v7l/neon/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/tls/v7l/neon/vfp", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/tls/v7l/neon/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/tls/v7l/neon", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/tls/v7l/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/tls/v7l/vfp", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/tls/v7l/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/tls/v7l", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/tls/neon/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/tls/neon/vfp", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/tls/neon/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/tls/neon", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/tls/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/tls/vfp", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/tls", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/v7l/neon/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/v7l/neon/vfp", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/v7l/neon/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/v7l/neon", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/v7l/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/v7l/vfp", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/v7l/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/v7l", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/neon/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/neon/vfp", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/neon/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/neon", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/vfp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj/vfp", 0xbeb2be60) = -1 ENOENT (No such file or directory)
open("/home/ubuntu/tfj/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/home/ubuntu/tfj", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=9775, ...}) = 0
mmap2(NULL, 9775, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "177ELF1113(1AU1004"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=918976, ...}) = 0
mmap2(NULL, 955668, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4001f000
mprotect(0x400fb000, 32768, PROT_NONE) = 0
mmap2(0x40103000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xdc) = 0x40103000
mmap2(0x40106000, 9492, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40106000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001b000
set_tls(0x4001b6d0, 0xf0005, 0x4001bda8, 0x4001b6d0, 0x4001e000) = 0
mprotect(0x40103000, 8192, PROT_READ) = 0
mprotect(0x4001d000, 4096, PROT_READ) = 0
munmap(0x40018000, 9775) = 0
readlink("/proc/self/exe", "/opt/valgrind/bin/valgrind", 4096) = 26
brk(0) = 0x14000
brk(0x35000) = 0x35000
execve("/opt/valgrind/lib/valgrind/memcheck-arm-linux", ["valgrind"], [/* 21 vars */]) = 0
open("/proc/self/maps", O_RDONLY) = 3
read(3, "38000000-382e9000 r-xp 00008000 "..., 100000) = 303
read(3, "", 99697) = 0
close(3) = 0
mmap2(0x6174a000, 4194304, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, 0, 0) = 0x6174a000
getrlimit(RLIMIT_DATA, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
setrlimit(RLIMIT_DATA, {rlim_cur=0, rlim_max=RLIM_INFINITY}) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
rt_sigprocmask(SIG_UNBLOCK, [ILL FPE], [], 8) = 0
rt_sigaction(SIGILL, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGFPE, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGILL, {0x38031d9c, [], SA_NODEFER}, NULL, 8) = 0
rt_sigaction(SIGFPE, {0x38031d9c, [], SA_NODEFER}, NULL, 8) = 0
rt_sigaction(SIGILL, {SIG_DFL, [], 0}, NULL, 8) = 0
rt_sigaction(SIGFPE, {SIG_DFL, [], 0}, NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
getcwd("/home/ubuntu", 4095) = 13
open("/home/ubuntu/.valgrindrc", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "valgrind: no program specifiedn", 31valgrind: no program specified
) = 31
write(2, "valgrind: Use --help for more in"..., 43valgrind: Use --help for more information.
) = 43
exit_group(1) = ?

Facebooktwittergoogle_plustumblrmail
Yusuke Dada K.
Yusuke Dada K.

台湾の現地企業で主に組み込みソフトウエアの研究開発をしている日本人です。我人是個日本人,負責軟體的研究開發。在臺灣的科技公司工作。

コメントする

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です