collect2.exe 有什么作用? [英] What does collect2.exe do?

查看:28
本文介绍了collect2.exe 有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我检查 gcc -v -o proggy.exe proggy.o 生成的代码时,我发现命令行扩展为一大堆库选项和库,所有这些都使用 collect2.exe 链接.ld.exe怎么了?为什么我看不到?有人可以向我解释一下 collect2.exe 的作用吗?

When I examine the code generated by gcc -v -o proggy.exe proggy.o I find that the command line expands into a large bunch of library options and libraries, all of which are linked using collect2.exe. What happened to ld.exe? Why don't I see that? Can someone explain to me what collect2.exe does?

推荐答案

collect2 是一个实用程序,用于生成构造函数表,__main(自动生成的函数在 main 的开头调用)依赖于.通常你看不到它,因为它在文件系统上被命名为 ld,然后它又调用了真正的 ld(通常称为 real-ld,尽管 collect2 会检查一个寻找它的地方的数量)

collect2 is a utility used to generate a table of constructors that __main (an auto-generated function called at the beginning of main) depends on. Normally you don't see it because it's named ld on the file system, and it in turn calls the real ld (typically called real-ld, although collect2 will check a number of places looking for it)

这篇关于collect2.exe 有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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