如何查看linux动态库中包含哪些函数

如何查看linux动态库中包含哪些函数,第1张

1、方法1

nm *.so

2、方法2

readelf -a *.so

PS:readelf

Options are:

-a --all Equivalent to: -h -l -S -s -r -d -V -A -I

-h --file-header Display the ELF file header

-l --program-headers Display the program headers

--segments An alias for --program-headers

-S --section-headers Display the sections' header

--sections An alias for --section-headers

-g --section-groupsDisplay the section groups

-t --section-details Display the section details

-e --headers Equivalent to: -h -l -S

-s --syms Display the symbol table

--symbols An alias for --syms

-n --notes Display the core notes (if present)

-r --relocsDisplay the relocations (if present)

-u --unwindDisplay the unwind info (if present)

-d --dynamic Display the dynamic section (if present)

-V --version-info Display the version sections (if present)

-A --arch-specific Display architecture specific information (if any).

-c --archive-index Display the symbol/file index in an archive

-D --use-dynamic Use the dynamic section info when displaying symbols

-x --hex-dump=<number|name>

Dump the contents of section <number|name>as bytes

-p --string-dump=<number|name>

Dump the contents of section <number|name>as strings

-R --relocated-dump=<number|name>

Dump the contents of section <number|name>as relocated bytes

-w[lLiaprmfFsoR] or

--debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=str,=loc,=Ranges]

Display the contents of DWARF2 debug sections

-I --histogram Display histogram of bucket list lengths

-W --wide Allow output width to exceed 80 characters

@<file> Read options from <file>

-H --help Display this information

学会使用man

命令,例如查询read函数

因为read在linux也是命令,说要到man

2种查询

输入man

2

read

就可以看到read的详细用法,以及头文件了


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8499967.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-17
下一篇 2023-04-17

发表评论

登录后才能评论

评论列表(0条)

保存