What does collect2.exe do?

前端 未结 2 683
遥遥无期
遥遥无期 2021-02-06 04:38

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 lin

2条回答
  •  天涯浪人
    2021-02-06 05:00

    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)

提交回复
热议问题