Date: Tue, 16 Jul 2019 02:57:24 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 239238] ldd(1) showing dependencies for shared objects in same name in library paths instead of in current directory Message-ID: <bug-239238-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239238 Bug ID: 239238 Summary: ldd(1) showing dependencies for shared objects in same name in library paths instead of in current directory Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: msl0000023508@gmail.com ldd(1) should show the dependencies of the program in current directory; however when a shared object file is given, and its file name is same with another shared object under library path (such as /usr/local/lib /usr/lib /lib), ldd(1) will showing dependencies for the shared object under library path. For example: [root@test ~/src]# uname -a FreeBSD test 13.0-CURRENT FreeBSD 13.0-CURRENT r349753 GENERIC amd64 [root@test ~/src]# ls -l /usr/lib/libfetch.so.6 -r--r--r-- 1 root wheel 81496 Jul 5 15:16 /usr/lib/libfetch.so.6 [root@test ~/src]# ldd /usr/lib/libfetch.so.6 /usr/lib/libfetch.so.6: libssl.so.111 => /usr/lib/libssl.so.111 (0x800695000) libcrypto.so.111 => /lib/libcrypto.so.111 (0x800e00000) libc.so.7 => /lib/libc.so.7 (0x800242000) libthr.so.3 => /lib/libthr.so.3 (0x80072e000) [root@test ~/src]# ls -l libfetch.so.6 ls: libfetch.so.6: No such file or directory [root@test ~/src]# ldd libfetch.so.6 ldd: libfetch.so.6: No such file or directory [root@test ~/src]# cat dummy.c #include <stdio.h> void useless() { fprintf(stderr, "You just called an useless function\n"); } [root@test ~/src]# gcc --shared -Wall -O1 -fPIC dummy.c -o libfetch.so.6 [root@test ~/src]# ls -l libfetch.so.6 -rwxr-xr-x 1 root wheel 7384 Jul 16 10:46 libfetch.so.6 [root@test ~/src]# file libfetch.so.6 libfetch.so.6: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, with debug_info, not stripped [root@test ~/src]# ldd libfetch.so.6 libfetch.so.6: libssl.so.111 => /usr/lib/libssl.so.111 (0x800695000) libcrypto.so.111 => /lib/libcrypto.so.111 (0x800e00000) libc.so.7 => /lib/libc.so.7 (0x800242000) libthr.so.3 => /lib/libthr.so.3 (0x80072e000) [root@test ~/src]# ldd ./libfetch.so.6 ./libfetch.so.6: libc.so.7 => /lib/libc.so.7 (0x800242000) -- You are receiving this mail because: You are the assignee for the bug.help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-239238-227>
