如何检查共享库是否与 -Bsymbolic 链接?

How to check if a shared library is linked with -Bsymbolic?

如何检查共享库是否与 -Bsymbolic 标志链接?

我试过 nm <path/to/lib.so> | grep -i symbolic,但是,与 -Wl,-Bsymbolic 链接的库没有输出。

您可以检查库的动态部分:

$ readelf -d a.out | grep SYMBOLIC
 0x0000000000000010 (SYMBOLIC)           0x0
 0x000000000000001e (FLAGS)              SYMBOLIC