swift
b29ec4a9 - Use an `.init_array` function to capture argc/argv on Linux.

Commit
331 days ago
Use an `.init_array` function to capture argc/argv on Linux. Per the ELF specification, the `.init_array` section contains a list of functions that need to be called before `main()` to initialize a library (i.e. libSwiftCore.so). The functions in this section take the initial values of `argc`, `argv`, and `environ` as arguments. This gives us an opportunity to capture/copy these values before `main()` is called in a way that may be more reliable than the current "inspect the stack" mechanism used on Linux (and derived platforms such as Android.)
Author
Parents
Loading