Dynamic linking best practices (2021)
3 points by abhin4v
3 points by abhin4v
The pre-main() initialization routine of a program loads ld.so and runs it from within the program to find and load the rest of the required libraries.
That’s what the 1988 paper says the SunOS linker did. But ELF works somewhat differently: executables can declare an “ELF interpreter” (ie, the runtime linker) in which case the kernel runs the linker instead of the original executable (like a #! line) and the linker loads and runs the program and its libraries. (more details)