The __libc_start_main function:

  • Locate environment variables on the stack
  • Prepare the auxiliary vector, if required.
  • Initialize thread-specific functionality (i.e. pthreads)
  • Perform some security-related book-keeping.
  • Initialize libc itself.
  • Call the program initialization function through the passed pointer (init).
  • Register the program finalization function (fini) for execution on exit.
  • Call main(argc, argv, envp)
  • Call exit with the result of main as the exit code.