示例:
nm -D xxx.so | grep " T "
加上-D
参数,打印结果能输出动态库名称:
nm -D -A xxx.so | grep " T "
如果要查找一个函数在哪个动态库下,但目录中有很多动态库,不知道在哪个里面,可以用这条命令一个个查找:(/path/to/directory
是要查找的路径)
find /path/to/directory -name "*.so" -exec nm -D -A {
} \; | grep "函数名"
比如我要在当前文件夹查找cw_alg_add这个函数:
find . -name "*.so" -exec nm -D -A {
} \; | grep "cw_alg_add"
如果不想把其他带后缀的函数也搜索出来,也可以在要搜索的函数后加上$