Linking a C program directly with ld fails with undefined reference to `__libc_csu_fini`

后端 未结 8 1493
被撕碎了的回忆
被撕碎了的回忆 2020-11-30 08:54

I\'m trying to compile a C program under Linux. However, out of curiosity, I\'m trying to execute some steps by hand: I use:

  • the gcc frontend to produce assemb
8条回答
  •  被撕碎了的回忆
    2020-11-30 09:32

    Assuming that a normal invocation of gcc -o hello hello.c produces a working build, run this command:

    gcc --verbose -o hello hello.c
    

    and gcc will tell you how it's linking things. That should give you a good idea of everything that you might need to account for in your link step.

提交回复
热议问题