Linkers, Loaders & Executables
What does running the ldd command on an executable on Linux show?
- AThe shared libraries the executable needs and where each is found
- BThe executable's source code
- CThe CPU time the executable used
Show answer and explanation
Answer: A. The shared libraries the executable needs and where each is found
ldd lists the shared libraries used by a dynamically linked executable or shared library and which file each resolves to. Missing ones are shown as "not found", which helps diagnose a program that will not start. Note that running it on an untrusted executable can execute code inside it, so care is needed.
- A. Correct. It is used to examine dependencies.
- B. Source code is not contained in the executable.
- C. CPU time is measured with commands such as time.