The init section is the initialization work code before the main function, such as the construction of global variables. The fini section is responsible for cleaning up after the main function. So, under the standard Linux platform, the order of link is: ld crt1.
This is because it will be called as a function of the crt0. The object file of the program will be linked at the beginning of each user's execution program, which is mainly used to set some initialization global variables. Generally, when gcc is used to compile and link to generate a file, gcc will automatically link the code of the file as the first module in the executable program. You can clearly see this link operation process by using the display detailed information option "-v" during compilation.
Therefore, in the normal compilation process, we do not need to specify the stub module crt0. In order to use ELF format object files and create shared library module files, the current compiler has expanded crt0 into several modules: crt1. Learn more about this site.
Search for crt1. You have searched for paths that end with crt1. This Document Entire Library. Documentation Home » Oracle Solaris Language: English. Any other use is unsupported. Such use can result in undefined and non-portable behavior. Applications requiring code to execute at startup have a variety of supported options.
0コメント