Have you ever before had a program collision prior to your
major feature carries out? it is uncommon, yet it can take place. When it does, you require to recognize what takes place behind the scenes in between the moment the os begins your program and also your initial line of code in
major carries out. The Good News Is [Patrick Horgan] has a tutorial about the subject that’s really outlined. It does not cover statically connected collections yet, as he mentions, if you recognize what he does cover, that’s very easy to identify by yourself.
The os, it ends up, understands absolutely nothing regarding major. It does, nonetheless, find out about a sign called _ begin. Your runtime collection gives this. That code consists of some pile control and also ultimately calls
__ libc_start_main which is likewise supplied by the collection.
From there, you end up with some hoax to handle the program’s atmosphere and also even more collection calls such as
__ libc_init_first and also
__ libc_init do some even more arrangement job. You would certainly believe that would certainly obtain you close, yet there’s plenty even more to do consisting of establishing for
at_exit and also thunking for position-independent code, in addition to dynamically connected collections.
This is just one of those subjects it will certainly look like you do not truly require up until you do. Also if you utilize one more language to create executables, they all need to adhere to these actions someplace. Approved, for several languages the start-up is fixed and also not likely to need you to debug it, yet it is still excellent to understand what’s taking place under the hood.
If you desire a fast Linux setting up tutorial, have at it. If you favor to shovel your setting up right into a C resource code data, you can do that, also.