$linuxjunkies
>

ld.so

also: dynamic linker, runtime linker, ld-linux, ld-linux-x86-64.so.2

The dynamic linker and loader in Linux that resolves library dependencies and loads shared libraries into memory at program startup. It prepares executable files to run by linking them with their required dynamic libraries.

ld.so is the runtime linker responsible for finding, loading, and binding shared libraries (like libc.so.6) that a program needs to execute. When you run a dynamically linked executable, the kernel doesn't directly execute your program's code—instead, it starts ld.so, which handles all the library setup before handing control to your program.

The most commonly used version is ld-linux-x86-64.so.2 on 64-bit x86 systems. You can see which linker a binary uses with ldd or by examining the ELF header. The linker searches for libraries in directories specified by LD_LIBRARY_PATH, /etc/ld.so.cache, and standard system paths like /lib and /usr/lib.

Example: when you run /usr/bin/ls, the kernel actually starts ld-linux-x86-64.so.2, which locates and loads libc.so.6 and other dependencies, then jumps to ls's main function. This happens invisibly and takes milliseconds.

Related terms