static or not static ...

Gian Lorenzo Meocci glmeocci@gmail.com
Wed Mar 12 16:09:00 GMT 2008


Hi,

I have compiled successfully program with -static and in fact if I try
ldd I obtain:

meox@ciop:~/mysql_normal/bin$ ldd mysqlshow
        not a dynamic executable

But if I run it with strace I see this:

....

open("/home/meox/myglibc//lib/libnss_files.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\30"..., 512) = 512
fstat64(4, {st_mode=S_IFREG|0755, st_size=158990, ...}) = 0
old_mmap(NULL, 41624, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
4, 0) = 0xb7f51000
old_mmap(0xb7f5a000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x8000) = 0xb7f5a000
close(4)                                = 0
open("/home/meox/myglibc//lib/libc.so.6", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200e\1"..., 512) = 512
fstat64(4, {st_mode=S_IFREG|0755, st_size=7449960, ...}) = 0

...

How is possible that the program open libc.so??? And WHY???

Thanks,


-- 
Gian Lorenzo Meocci
http://www.meocci.it



More information about the Libc-alpha mailing list