开发者

What does collect2.exe do?

开发者 https://www.devze.com 2022-12-30 06:24 出处:网络
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 usin

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 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)


GCC uses a utility called collect2 on nearly all systems to arrange to call various initialization functions at start time. [link]

0

精彩评论

暂无评论...
验证码 换一张
取 消