musl libc dynamic loading: execution flow from elf application entry function _start to main

Preface

  • Application elf, such as a statically linked application, the entry function is not the main function, but _startthe function

  • From _startfunction to main function, after a series of initialization operations of libc

  • _start -> _start_c -> ... -> main

  • The dynamically compiled and linked application elf has gone through the loading and running process of _dlstart-> _dlstart_c-> ...-> _start-> _start_c-> ...->main

  • The purpose of this article: debug and sort out the process of application execution from the entry function to the user program main function

musl ldso entry function execution process

  • musl libc.so _dlstart: The entry function of the application. Note that the operation of executing the entry function of musl ldso (that is, musl libc.so) is implemented by the kernel.

Insert image description here

  • Application entry function execution flow: Whether it is static link or dynamic link, it starts from

Guess you like

Origin blog.csdn.net/tcjy1000/article/details/132772822