Build
约 1 分钟阅读
获取动态链接的库
Be aware that ldd actually runs the executable with a special environment variable, and the Linux dynamic linker recognizes this flag and just outputs the libraries rather than running the executable. Look at the source to ldd; on my system, it's a bash script. If the executable is statically linked and uses syscalls, and specifies a different loader, it can do arbitrary evil things. So don't use ldd on an executable you don't trust.
ldd exec
objdump -p exec
lsof -P -T -p $(pidof exec)
readelf -d /bin/ls | grep 'NEEDED'
# macOS
otool -L exec关联信息
反向链接、本文链接的其他页面和外部资料。
反向链接
- Linux笔记 · 构建
Linux 是一个 Unix-like 操作系统,最初作为 Minix 的扩展实现 [Tanenbaum 1987],早期版本只支持 Minix 文件系统;Minix 文件系统有两个限制:block 地址用 16 位整数存储(文件系统最大 64 MB),目录项固定大小(文件名最长 14 字符)。