What is the difference between dynamic and static binding?
Static binding is where the linker copies the called function
into the program's executable image from the appropriate library
and resolves the references to the function at compile/link time.
The program contains a copy of the library function and does not
need to load it at run time.
Dynamic binding is where the linker inserts stub code into the
program's executable image that references the appropriate library.
The library function is then copied into memory at load or run time
and references are resolved then. The program does not contain a
copy of the library function, and the library must be accessible at
load/run time.
There are two kinds of dynamic binding. The first is load time,
where the library must be loaded before the program starts to
execute. In this case, if the library is not found, load fails and
the program does not run. The second is run time, where the library
must be loaded at the point of first access. This occurs after then
program starts to execute, and the program can change its behavior
depending on options or library availability.