This causes the system loader to load all these shared objects so that the runtime linker can use their definitions. If the -brtl option is not used, a shared object that is not referenced by the program is not listed, even if it provides definitions that might be needed by another shared object used by the program. A shared object contained in an archive is only listed if the archive specifies automatic loading for the shared object member. In dynamic mode, input files specified with the -l flag may end in .so , as well as in .a . That is, a reference to -lfoo is satisfied by the first libfoo.so or libfoo.a found in any of the directories being searched.
Dynamic mode is in effect by default unless the -bstatic option is used.
The runtime linker mimics the behavior of the ld command when static linking is used, except that only exported symbols can be used to resolve symbols. Even when runtime linking is used, the system loader must be able to load and resolve all symbol references in the main program and any module it depends on. Therefore, if a definition is removed from a module, and the main program has a reference to this definition, the program will not execute, even if another definition for the symbol exists in another module. The runtime linker can rebind all references to symbols imported from another module. A reference to a symbol defined in the same module as the reference can only be rebound if the module was built with runtime linking enabled for that symbol.