Shared library
Computer file designed for mutual use by other files / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Shared libraries?
Summarize this article for a 10 year old
A shared library or shared object is a computer file that contains executable code designed to be used by multiple computer programs at runtime.
This article or section may need to be cleaned up or summarized because it has been split from/to Library (computing). |
This article needs additional citations for verification. (July 2023) |
When running a program that is configured to use 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. For perspective, a program can alternatively be monolithic -- built to include the executable code of the library in its executable file, but the library code embedded in the program's executable file is not usable by other programs.
Shared libraries can be statically linked at compile-time, meaning that references to the library are resolved and the library is allocated memory when the executable file is created.[citation needed] But often linking of shared libraries is postponed until they are loaded.[dubious ā discuss]
Most modern operating systems use the same format for both shared libraries and executable files.[NB 1] This offers two main advantages: first, it requires only one loader (building and maintaining a single loader is considered well worth any added complexity)[citation needed]. 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.