追踪源代码到二进制文件

发布于 2024-10-04 13:01:06 字数 198 浏览 0 评论 0原文

我试图了解特定包如何适合我正在从事的项目。我相信这个包中只有一部分实际上进入了项目的二进制文件,我需要找出到底是哪些部分。这个包中的库函数可以从许多其他地方调用(即其他几个包依赖于它)。

我计划构建该项目并分发它。是否是通过查看依赖包中的所有标头来确定我将分发哪些源代码->二进制文件的唯一方法?或者有更聪明的方法来解决这个问题吗?

提前致谢,

I'm trying to understand the way a particular package fits into a project I'm working on. I believe only a portion of this package actually makes it into the binary of the project, and I need to find out exactly which parts. Library functions from this package are called from many other places (i.e. several other packages depend on it).

I plan to build the project and distribute it. Is the only way to determine which source->binary files I'll distribute by looking at all of the headers in my dependent packages? Or is there a more clever way to approach this?

Thanks in advance,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

执着的年纪 2024-10-11 13:01:06

您没有向我们提供太多信息,但这里有一个可行的方法:删除包的一部分并查看项目是否仍然可以编译。

You haven't given us much information to go on, but here's a method that will work: remove parts of the package and see if the project will still compile.

情感失落者 2024-10-11 13:01:06

使用 nm 解压静态库。这将列出库中包含的所有文件和方法。

您也可以尝试使用字符串。
这将显示二进制文件中定义的字符串。

查看您的源代码并查看您定义的字符串是否在库中。

像 gprof 这样的东西也可以用来查看可执行文件调用了哪些方法。

Use nm to unpack a static lib. This will list all the files and methods included in the lib.

You could also try using strings.
This displays strings that are defined in the binary.

Look through your source and see if the strings you define are in the library.

Something like gprof could also be used to see which methods are called by your executable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文