Shared library
A shared library or shared object is a computer file that contains executable code designed to be used by multiple computer programs or other libraries at runtime, with a single copy of the library's executable code in memory. This differs from a static library, code from which is copied into the executable image file of the program when the linker builds that file, so that each program has its own copy of that code in memory.
When running a program that uses a shared library, the operating system loads the shared library from a file (other than the program's executable file) into memory at load time or runtime.
Most modern operating systems use the same format for both shared libraries and executable files. This offers two main advantages: first, it requires only one loader (building and maintaining a single loader is considered well worth any added complexity). Secondly, it allows an executable file to be used as a shared library (if it has a symbol table). Examples include Unix ELF and Mach-O and Windows PE.
In some older environments such as 16-bit Windows or MPE for the HP 3000, only stack-based data (local) was allowed in shared library code, or other significant restrictions were placed on shared library code.