Questions tagged [ldd]

ldd is a unix command-line tool to print shared library dependencies for an executable or shared library.

If a program is dynamically linked, i.e. uses shared libraries, the program requires some number of external libraries in order to run. ldd is a tool to list the required libraries and shows if those libraries can be found in the current configuration.

Questions about using and understanding ldd output should use this tag.

From a unix command-line running

man ldd

will provide more information.

254 questions
17
votes
1 answer

‘ldd -r’ equivalent on macOS

I am trying to make my software available on macOS, and in my toolchain I use the ldd -r MyModel.so command to verify that everything went well, but I can’t really find an equivalent command on macOS with the same behavior. otool and nm seem to be…
Gautier Bureau
  • 183
  • 1
  • 1
  • 9
15
votes
1 answer

Update ldconfig cache without root permission

$ uname -a Linux xhost10.bcgsc.ca 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux $ /sbin/ldconfig --version ldconfig (GNU libc) 2.5 I am installing several binaries and libraries locally, since I do not have root…
David Shih
  • 402
  • 1
  • 3
  • 7
15
votes
4 answers

How to add shared library search path to a executable file?

I build the ffmpeg with librtmp. My librtmp is at /opt/librtmp/lib. When I execute the ffmpeg, it said: ./ffmpeg: error while loading shared libraries: librtmp.so.0: cannot open shared object file: No such file or directory I use ldd command it…
qrtt1
  • 7,746
  • 8
  • 42
  • 62
14
votes
2 answers

How are shared library dependency paths determined on Linux?

When I run ldd against a shared library such as libphp5.so I see that it has a dependency on libmysqlclient.so.16: $ ldd ./libphp5.so libmysqlclient.so.16 => /usr/lib/mysql/libmysqlclient.so.16 [other dependencies snipped out] Are these…
Kev
  • 118,037
  • 53
  • 300
  • 385
14
votes
1 answer

What's the difference between "statically linked" and "not a dynamic executable" from Linux ldd?

Consider this AMD64 assembly program: .globl _start _start: xorl %edi, %edi movl $60, %eax syscall If I compile that with gcc -nostdlib and run ldd a.out, I get this: statically linked If I instead compile that with gcc -static…
13
votes
2 answers

Understanding ldd output

How does ldd knows it's depending on libc.so.6 ,not libc.so.5 or libc.so.7? libc.so.6 => /lib64/libc.so.6 (0x00000034f4000000) /lib64/ld-linux-x86-64.so.2 (0x00000034f3c00000)
compile-fan
  • 16,885
  • 22
  • 59
  • 73
13
votes
2 answers

What is the clang analogue of ldd?

How do I find out what DLLs an executable depends on? On systems with the GNU development toolchain (gcc &c) I use ldd for that, but what about the clang systems, like, e.g., Mac OS X (which does not have ldd)?
sds
  • 58,617
  • 29
  • 161
  • 278
13
votes
1 answer

Explanation of ldd output

Can someone explain to me the output of ldd command? In the following example (on Gentoo system) $ ldd /bin/date linux-vdso.so.1 => (0x00007fff6ffff000) librt.so.1 => /lib64/librt.so.1 (0x00007f54ba710000) libc.so.6 => /lib64/libc.so.6…
CyberMuz
  • 359
  • 4
  • 12
13
votes
1 answer

ldd hex number in parentheses

When executing ldd on a file, it returns a hex number in parentheses for every library it found. For example: root@server> ldd wpa_supplicant linux-gate.so.1 => (0xb779b000) libnl.so.1 => /usr/lib/libnl.so.1 (0xb774d000) …
Zulakis
  • 7,859
  • 10
  • 42
  • 67
12
votes
1 answer

ldd shows varied addresses on x86 Linux

I am using ldd to show the dynamic library on Fedora/x86, and it shows different results each time it is used. Is that expected? Or is there an explanation? I remember it shows a fixed result on PPC/Linux. `ldd /bin/ls linux-gate.so.1 => …
tristan
  • 4,235
  • 2
  • 21
  • 45
12
votes
1 answer

Tool for Library Dependency

I'm looking for the tool/command on Unix platform to detect the library dependencies of the .so and .o files. I have already used the ldd/nm/truss, but I don't know the proper approach to detect library dependencies.
Abinash Bishoyi
  • 187
  • 1
  • 2
  • 13
11
votes
1 answer

gcc link shared library against symbolic link

I have two libraries, for example two toaster libraries libtoaster_a.so and libtoaster_b.so and all the associated major/minor/rev symlinks eg libtoaster_a.so.1.0.0 etc. Both libraries implement the same toaster interface, but simply do the…
othane
  • 143
  • 1
  • 5
11
votes
3 answers

undefined reference to symbol 'dlsym@@GLIBC_2.4'

First off, please keep in mind that I'm new to linux. I'm having problems compiling my project. I keep get the following error: /usr/bin/ld: CMakeFiles/Robot.dir/source/ModuleHandler.cpp.o: undefined reference to symbol 'dlsym@@GLIBC_2.4' …
Nathan
  • 135
  • 1
  • 2
  • 9
10
votes
3 answers

Unable to compile: unrecognized relocation

I'm unable to compile anything in my linux pc. I have no idea why, probably I've installed some package and made a mess. I've uninstalled and reinstalled gcc and other packages, but no good news.. still this problem. This is the…
gabib44
  • 119
  • 1
  • 1
  • 4
10
votes
1 answer

Make standalone curl leads to segfault

I would like to build a standalone version of `curl without any library dependency (even libc) for an embedded system with a very old libc version. From current curl github, I configure the compilation with this command: ./configure --disable-shared…
Julio
  • 2,493
  • 4
  • 33
  • 53
1
2
3
16 17