C语言 找出静态 C 库具有哪些功能

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2540268/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 04:59:56  来源:igfitidea点击:

Find out what functions a static C library has

cstatic-librariesdumpdisassembly

提问by cd1

I have a static C library (say mylib.a) and I was wondering if it's possible to find out what functions are implemented inside that file. I don't have a corresponding header file. what I need is like the equivalent of javapfor Java.

我有一个静态 C 库(比如mylib.a),我想知道是否有可能找出该文件中实现了哪些函数。我没有相应的头文件。我需要的是相当于javapJava 的。

回答by James McNellis

On Windows you can use dumpbin. On Linux and friends you can use nm.

在 Windows 上,您可以使用dumpbin. 在 Linux 和朋友上,您可以使用nm.

回答by nos

Use nm. That will only give you the symbol names - of which most of the symbols prefixed with Twill be functions. Function arguments are not retained in the binary.

使用nm。那只会给你符号名称 - 其中大多数带有前缀的符号T都是函数。函数参数不保留在二进制文件中。