c++ - 在 GCC 中列出库函数

标签 c++ c gcc

是否可以在 GCC 命令行中列出任何库/头文件中可用的所有库函数? 是否有类似 JAVAP 之类的可用于 Java 的程序? 谢谢。

最佳答案

您可以使用 objdump 列出共享库(或可执行文件)中的符号:

$objdump -T /usr/lib/libclang.so
<...snipped...>
0000000000124150 g    DF .text  00000000000000c1  Base        clang_reparseTranslationUnit
000000000010fe40 g    DF .text  0000000000000021  Base        clang_getNullRange
0000000000135760 g    DF .text  000000000000009f  Base        clang_getPointeeType
0000000000124290 g    DF .text  0000000000000289  Base        clang_parseTranslationUnit
000000000012b790 g    DF .text  0000000000000935  Base        clang_findReferencesInFile
0000000000110b80 g    DF .text  000000000000001c  Base        clang_getRangeEnd
0000000000127d20 g    DF .text  0000000000000022  Base        clang_disposeCodeCompleteResults
0000000000135e10 g    DF .text  0000000000000037  Base        clang_isPODType

000000000010f870 g DF .text 0000000000000025 Base clang_getTranslationUnitCursor 0000000000129b50 g DF .text 00000000000002c1 Base clang_getDiagnosticOption

如您所见,它列出了不同的符号及其相对地址。

关于c++ - 在 GCC 中列出库函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17493932/

相关文章:

c++ - CMake添加到Clang的包含路径

c++ - 如何在c++17中定义函数组合?

c - OpenSSL C RSA 库解密

C 编程中的字符搜索

c - 如何在 Sublime Text 3 中编译 C 程序?

c++ - 当我声明 root->right->right = newnode(7);评论,编译器显示运行时错误。谁能解释为什么?

ios - 知道编译 iOS 应用程序时 "dyld: Symbol not found: ___gcc_personality_sj0"是什么吗?

c++ - 复制结构的一部分

c++ - 在构造函数中代替 make_shared_from_this 有什么用?

c - 离开函数后值消失