Quote:
Originally Posted by sysbox
I'm aware of ldd. It takes the executable as an argument, not the name of a dynamic library.
|
Yes, and then it examines the executable file whose name you pass it to figure out which libraries that executable requires, which is what you asked for.
Quote:
Originally Posted by sysbox
How does ldd figure out which dynamic library to use?
|
It examines the executable file you pass it as an argument, determines which libraries it requires, and prints them out.
Quote:
Originally Posted by sysbox
I'd like to know if there is a tool that does that.
|
There is! It's called "ldd". Here's how it works:
Code:
$ ldd /bin/bash
linux-gate.so.1 => (0x00ee3000)
libtinfo.so.5 => /lib/libtinfo.so.5 (0x06ed7000)
libdl.so.2 => /lib/libdl.so.2 (0x008c9000)
libc.so.6 => /lib/libc.so.6 (0x0072c000)
/lib/ld-linux.so.2 (0x00708000)
Summary: The user types in "ldd" followed by the name of an executable. "ldd" examines the file whose name you give it an prints out a list of the libraries required by the executable.
Which is what you asked for.