ldd(1)
๐ ldd(1) โ print shared object dependencies ๐
okay bestie, welcome to ldd, a classic from the General Commands Manual section (that's section 1, the "commands you actually type" girlies). she's small, she's powerful, she tells you exactly which shared libraries your programs are leaning on. no cap. ๐ซถ
โจ NAME โจ
ldd โ print shared object dependencies
๐ธ SYNOPSIS ๐ธ
ldd [option ...] file ...
๐ฆ DESCRIPTION ๐ฆ
so what does ldd actually do?? she prints the shared objects (aka shared libraries, the besties your program links against at runtime) that each program or shared object you pass on the command line needs. like, every file you give her, she tells you what it depends on. iconic.
here's an example of her in action, and what the output looks like:
$ ldd /bin/ls;
linux-vdso.so.1 (0x00007ffcc3563000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f87e5459000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007f87e5254000)
libc.so.6 => /lib64/libc.so.6 (0x00007f87e4e92000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f87e4c22000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f87e4a1e000)
/lib64/ld-linux-x86-64.so.2 (0x00005574bf12e000)
libattr.so.1 => /lib64/libattr.so.1 (0x00007f87e4817000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f87e45fa000)
how she does it, in the usual case: ldd invokes the standard dynamic linker (go read ld.so(8) bestie) with the LD_TRACE_LOADED_OBJECTS environment variable set to 1. that little env var makes the dynamic linker peek at the program's dynamic dependencies, and then find (following the exact rules laid out in ld.so(8)) and load up the objects that satisfy those deps. for every single dependency, ldd shows you the location of the matching object and the (hexadecimal) address where it's loaded. โจโจโจ
quick lil note: thelinux-vdsoandld-linuxshared dependencies are special little guys โ checkvdso(7)andld.so(8)for the lore ๐ซ
๐ Security ๐
okay now the serious part, and I need you to actually listen because this one matters. in some circumstances (for example, when the program specifies an ELF interpreter that isn't ld-linux.so), some versions of ldd may try to grab the dependency info by directly executing the program. which can mean executing whatever code is defined in the program's ELF interpreter โ and possibly executing the program itself too. yikes. ๐ญ (before glibc 2.27, the upstream ldd implementation did exactly this, for example, though most distributions shipped a modified version that did not.)
so: you should NEVER use ldd on an untrusted executable, because it can result in the execution of arbitrary code. like, fr fr. a safer alternative when you're dealing with untrusted executables is:
$ objdump -p /path/to/program | grep NEEDED;
โ ๏ธ but heads up though: this alternative only shows the direct dependencies of the executable, whereas ldd shows the entire dependency tree of the executable. so it's safer but it's giving less. trade-offs, bestie. ๐
๐ OPTIONS ๐
--versionโ print the version number ofldd. that's it, that's the whole thing.--verbose,-vโ print ALL the information, including (for example) symbol versioning information. she's not holding back, she's spilling everything.--unused,-uโ print unused direct dependencies. (since glibc 2.3.4, so she's been doing this for a min ๐)--data-relocs,-dโ perform relocations and report any missing objects. (ELF only)--function-relocs,-rโ perform relocations for BOTH data objects and functions, and report any missing objects or functions. (ELF only)--helpโ usage information. the classic, the icon, the "help me pls" flag ๐
๐ BUGS ๐
ldddoes not work ona.outshared libraries. nope. not happening. ๐lddalso does not work with some extremely olda.outprograms โ the ones built beforelddsupport was even added to the compiler releases. if you runlddon one of these, the program will attempt to run withargc=0and the results will be unpredictable. so likeโฆ don't? ๐ฉ
๐ SEE ALSO ๐
pldd(1), sprof(1), ld.so(8), ldconfig(8)
so yeah that's ldd, she's tiny, she's nosy, she knows what your binaries are linked to. go check your deps bestie, and stay safe out there (seriously, not on untrusted executables, I'm begging ๐ฅบ).
mwah ๐ this page came to you from Linux man-pages 6.20, dated 2026-02-08.
๐ฆ where this page comes from
- arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- ๐ the page's license: GPL-1.0-or-later
- Copyright 1995-2000, David Engel <david@ods.com>
- Copyright 1995, Rickard E. Faith <faith@cs.unc.edu>
- Copyright 2000, Ben Collins <bcollins@debian.org>
- Copyright 2000, Jakub Jelinek <jakub@redhat.com>
- Copyright 2012-2016, Michael Kerrisk <mtk.manpages@gmail.com>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms