Linux command
ld.so 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run with library path
LD_LIBRARY_PATH=[/path/to/libs] [program]
Preload library
LD_PRELOAD=[/path/to/lib.so] [program]
Debug loading
LD_DEBUG=libs [program]
Show search paths
ldconfig -p
Update library cache
sudo ldconfig
说明
ld.so is the dynamic linker/loader. It loads shared libraries needed by programs at runtime. The loader resolves symbols and handles library dependencies. Environment variables control its behavior.
参数
- LD_LIBRARY_PATH
- Additional library directories.
- LD_PRELOAD
- Libraries to load first.
- LD_DEBUG
- Debug options (libs, reloc, files).
- LD_TRACE_LOADED_OBJECTS
- List dependencies (like ldd).
FAQ
What is the ld.so command used for?
ld.so is the dynamic linker/loader. It loads shared libraries needed by programs at runtime. The loader resolves symbols and handles library dependencies. Environment variables control its behavior.
How do I run a basic ld.so example?
Run `LD_LIBRARY_PATH=[/path/to/libs] [program]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does LD_LIBRARY_PATH do in ld.so?
Additional library directories.