通过设置export LD_DEBUG=symbols,然后运行主程序a.out, 可以看到符号查找的详细过程:

24484: symbol=printf; lookup in file=./a.out
24484: symbol=printf; lookup in file=/lib64/libdl.so.2
24484: symbol=printf; lookup in file=libc1.so
24484: symbol=printf; lookup in file=libc2.so
24484: symbol=printf; lookup in file=/lib64/tls/libc.so.6

文档更新时间: 2022-04-11 02:18   作者:suglow