As part of the initialization and execution of a dynamic executable, an interpreter is called to complete the binding of the application to its dependencies. In Solaris this interpreter is referred to as the runtime linker.
During the link-editing of a dynamic executable, a special .interp section, together with an associated program header, are created. This section contains a pathname specifying the program's interpreter. The default name supplied by the link-editor is that of the runtime linker -- /usr/lib/ld.so.1 for a 32-bit executable and /usr/lib/sparcv9/ld.so.1 for a 64-bit SPARCV9 executable.
During the process of executing a dynamic executable (see exec(2)) , the kernel maps the file (see mmap(2)), and using the program header information (see "Program Header") locates the name of the required interpreter. The kernel maps this interpreter and transfers control to it, passing sufficient information to allow the interpreter to continue binding the application and run it.
In addition to initializing an application, the runtime linker provides services that allow the application to extend its address space by mapping additional objects and binding to symbols within them.
The following is a simple breakdown of the runtime linker's functionality, and introduction to the topics covered in this chapter:
It analyzes the executable's dynamic information section (.dynamic) and determines what dependencies are required.
It locates and maps in these dependencies, and analyzes their dynamic information sections to determine if any additional dependencies are required.
Once all dependencies are located and mapped, the runtime linker performs any necessary relocations to bind these objects in preparation for process execution.
It calls any initialization functions provided by the dependencies.
It passes control to the application.
During the application's execution, the runtime linker can be called upon to perform any delayed function binding.
The application can also call upon the runtime linker's services to acquire additional objects by dlopen(3X), and bind to symbols within these objects with dlsym(3X).