命令行查看共享对象模块(lib * .so)的内容 [英] Command Line to see the contents Shared Object Module(lib*.so)

查看:120
本文介绍了命令行查看共享对象模块(lib * .so)的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查看共享对象模块(lib * .so)内容的命令行是什么?

What is the command line to see the contents of a Shared Object module (lib*.so)?

就像我们的用法一样:

ar -t lib*.a

用于归档文件(lib * .a),它显示了库中的所有目标文件.

for archives(lib*.a) and it displays all the object files in the library.

EDIT1

示例

Example

ar -t lib*.a

给我展示:

asset.o

sldep.o

推荐答案

使用nm -D --defined-only libname.so从动态库中获取符号名称.
--defined-only开关仅显示这些文件中定义的符号,而不显示对外部函数的引用.

use nm -D --defined-only libname.so to get the symbol names from your dynamic library.
The --defined-only switch shows you only the symbol that are defined in these files, and not references to external functions.

一种替代方法是使用objdump,并仅捕获文本部分中的符号:

An alternative is to use objdump, and catch only the symbols in the text section :

objdump -T /usr/lib/libjpeg.so | grep text
...
0001b5c0 g    DF .text  00000016  Base        jdiv_round_up
00003730 g    DF .text  00000417  Base        jpeg_set_colorspace
0000cda0 g    DF .text  000002de  Base        jpeg_consume_input
00002b30 g    DF .text  00000023  Base        jpeg_abort_compress
00003b50 g    DF .text  000000b6  Base        jpeg_default_colorspace
00002810 g    DF .text  00000067  Base        jpeg_suppress_tables
00004110 g    DF .text  00000130  Base        jpeg_add_quant_table
000100c0 g    DF .text  0000011f  Base        jpeg_save_markers
...

这篇关于命令行查看共享对象模块(lib * .so)的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆