|
In computer science, a library is a collection of subprograms used to develop software. Libraries are distinguished from executables in that they are not independent programs; rather, they are "helper" code that provides services to some other independent program. Today the vast majority of the code that executes in a typical application is located in the libraries it uses. Edsger Dijkstra said: Computer science is no more about computers than astronomy is about telescopes. ...
In computer science, a subroutine (function, procedure, or subprogram) is a sequence of code which performs a specific task, as part of a larger program, and is grouped as one, or more, statement blocks; such code is sometimes collected into software libraries. ...
Computer software (or simply software) refers to one or more computer programs and data held in the storage of a computer for some purpose. ...
A computer program (often simply called a program) is an example of computer software that prescribes the actions (computations) that are to be carried out by a computer. ...
Well-known libraries include: The process of making resources available to other programs in a library is called exporting. Most common forms of exports include procedures (functions, routines, subroutines), variables, and some sorts of static data, e.g. icons. Exported procedures are also called entry points, because invoking them is akin to "entering" the library. In order to allow access to them, the resources receive names, which are written down inside a table, also containing their offsets inside the file. These names (and sometimes, by analogy, the resources they represent) are called symbols. Similarly, the table is called a symbol table. Executables are less likely to have a symbol table (they are not mandatory and are usually stripped down to save space). Aside from that, from most other aspects, the difference between libraries and executables in modern operating systems is limited. LINPACK is a software library for numerical linear algebra. ...
The C standard library is a now-standardised collection of header files and library routines used to implement common operations, such as input/output and string handling, in the C programming language. ...
Glibc, also known as libc6, is the GNU projects C standard library. ...
The Standard Template Library (STL) is a software library. ...
C++ (pronounced see plus plus) is a general-purpose computer programming language. ...
Direct3D is part of Microsofts DirectX API. Direct3D is only for use in Microsofts various Windows operating systems (Windows 95 and above) and, although in a quite different version, in the Xbox. ...
OpenGL (Open Graphics Library) is a specification defining a cross-language cross-platform API for writing applications that produce 3D computer graphics (and 2D computer graphics as well). ...
A procedure is a series of activities, tasks, steps, decisions, calculations and other processes, that when undertaken in the sequence laid down produces the described result, product or outcome. ...
In computer science, a subroutine (function, procedure, or subprogram) is a sequence of code which performs a specific task, as part of a larger program, and is grouped as one, or more, statement blocks; such code is sometimes collected into software libraries. ...
In computer science and mathematics, a variable is a symbol denoting a quantity or symbolic representation. ...
In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each symbol in a programs source code is associated with information such as location, type and scope level. ...
Library linking describes the inclusion of one or more of these software libraries into a new program. There are multiple types of linking: static linking and dynamic linking. There are also different forms of dynamic libraries, shared or unshared. These are described below. Static linking
Static linking embeds a library directly into the program executable at compile time by a linker. A linker is a separate utility which takes one or more libraries and object files (which are previously generated by a compiler or an assembler) and produces an actual executable file. Internally all references to code located in the library are replaced with a pointer to the code; since it cannot move independently of the executable, this fixed offset will never change. In computer science, compile time, as opposed to runtime, is the time when a compiler compiles code written in a programming language into an executable form. ...
In computer science, a linker or link editor is a link to other pages. ...
In computer science, object file or object code is an intermediate representation of code generated by a compiler after it processes a source code file. ...
An executable or executable file, in computer science, is a file whose contents are meant to be interpreted as a program by a computer. ...
One of the biggest disadvantages of static linking is that each executable ends up containing its own copy of the library. When many statically linked programs using the same library are simultaneously executed on the same machine, a great deal of memory can be wasted, as each execution loads its own copy of the library's data into memory. Another disadvantage is that newer versions of the library need to be re-compiled into the executable. A newer version of the library included in program X doesn't help program Y; both must be upgraded separately. Examples of libraries which are traditionally designed to be statically linked include the ANSI C standard library and the ALIB assembler library. Static linked libraries predate Fortran; Fortran's I/O was designed to use a preexisting package of I/O routines. The C standard library is a now-standardised collection of header files and library routines used to implement common operations, such as input/output and string handling, in the C programming language. ...
Dynamic linking Dynamic linking systems place the majority of the linker code in the underlying operating system, in which case it is known as a loader. At compile time the linker only records what libraries the executable needs and checks to make sure they are being called properly. When that program is then executed, the loader finds these libraries and links them at that point, either at loadtime or during runtime when the library is actually referenced. The result is called a dynamically linked library, sometimes refered to as a DLL much due to the fact that dynamic libraries on Microsoft Windows are using the filename extension .dll. In computing, an operating system (OS) is the system software responsible for the direct control and management of hardware and basic system operations. ...
In computing, a loader is a program that performs the functions of a linker program and then immediately schedules the resulting executable program for action (in the form of a memory image), without necessarily saving the program as an executable file. ...
In computing, a loader is a program that performs the functions of a linker program and then immediately schedules the resulting executable program for action (in the form of a memory image), without necessarily saving the program as an executable file. ...
In computer science, runtime describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ...
Microsoft Windows is a range of closed source proprietary commercial operating environments for personal computers and servers. ...
A filename extension or filename suffix is an extra set of (usually) alphanumeric characters that is appended to the end of a filename to allow computer users (as well as various pieces of software on the computer system) to quickly determine the type of data stored in the file. ...
In a dynamic library the location of the actual code is unknown until after it has been loaded into memory. This means that storing the location of the code in the executable itself is impossible. It would be possible to examine the program at load time and replace all references with pointers once the location is known, but this is theoretically a time consuming process. Instead, most dynamic library systems include a table of the code being called that is linked into the program at compile time. This table, the import directory, is in a known location that the executable code is linked to. At load time the table is modified with the location of the library code by the loader/linker. The library itself contains a table of all the methods within it, known as entry points. Calls into the library "jump through" this table, looking up the location of the code in memory, then calling it. This introduces a small overhead in call time, but one that is so small as to be ignorable. The exact time that the library is loaded into memory varies from system to system. In some, including Windows and Linux, all linking takes place when the executable is first loaded. This type of dynamic linking is called loadtime linking. Microsoft Windows is a range of closed source proprietary commercial operating environments for personal computers and servers. ...
Tux, a penguin, is the official Linux mascot. ...
Other operating systems resolve dependencies at runtime. In these systems the executable calls an operating system API, passing it the name of a library file, a function number within the library and the function's parameters. The operating system resolves the import immediately and calls the appropriate function on behalf of the application. This type of dynamic linking is called runtime linking. Because of the overhead added to each call, runtime linking is slow and negatively affects an executable's performance. As a result, runtime linking is rarely used by modern operating systems. Dynamic linkers/loaders vary widely in functionality. Some write down explicit paths to the libraries, based on some "known" location for library storage. Any change to the library naming or layout of the filesystem will cause these systems to fail. More commonly only the name of the library itself is stored, with the operating system supplying a system to find the library on-disk based on some algorithm. Unix-based systems use a PATH variable of "places to look", which tends to be robust as the PATH rarely changes. On the downside this forces developers to place their libraries in one of several "known" locations, which tend to fill up and make management more complex. On Microsoft systems the PATH variable is also used, but only after checking the current working directory, the directory set by SetDllDirectory(), and the system32, system and windows directories. However, often times libraries are stored outside of these locations, so the registry is used to determine the correct location. OpenStep used a more flexible system, collecting up a list of libraries from a number of known locations (similar to the PATH concept) when the system first starts. Moving libraries around causes no problems at all, although there is a time cost when first starting the system. UNIX is a portable, multi-tasking and multi-user computer operating system originally developed by a group of AT&T Bell Labs employees including Ken Thompson, Dennis Ritchie, and Douglas McIlroy. ...
OpenStep is an open object-oriented API specification for an object-oriented operating system that uses any modern operating system as its core, principly developed by NeXT. It is important to recognize that while OpenStep is an API specification, OPENSTEP (all capitalized) is a specific implementation of this OpenStep developed...
One of the largest disadvantages of dynamic linking is that the executables depend on the separately stored libraries in order to function properly. If the library is deleted, moved, renamed or replaced with an incompatible version, the executable could malfunction. On Windows this is commonly known as DLL hell. DLL hell is a colorful term given to any problem based on a difficulty in managing Dynamically Linked Libraries (DLLs) installed on a particular copy of an operating system. ...
Dynamic linking libraries date back to at least MTS (the Michigan Terminal System), built in the late 60s. ("A History of MTS", Information Technology Digest, Vol. 5, No. 5)
Dynamic loading Additionally, a library may be loaded dynamically during the execution of a program, as opposed to when the program is loaded to main memory or started from main memory. The loading of the library is thus delayed until it is needed, and if it is never needed, it is never loaded. Such a library is referred to as a dynamically loaded library (DLL) - different from Windows-type DLL. This form of library is typically used for plug-in modules and interpreters needing to load certain functionality on demand. A plugin (or plug-in) is a computer program that can, or must, interact with another program to provide a certain, usually very specific, function. ...
Interpreter can mean one of the following: In communication, an interpreter is a person whose role is to facilitate dialogue between two parties that do not use the same language. ...
Most systems supporting dynamic libraries also support dynamic loading via API in the underlying operating system. Under some systems the programmer must be careful to ensure the library is loaded before calling it, while others automate this process as well. Internally the differences are invisible, libraries loaded either way are handled identically.
Remote libraries Another solution to the library issue is to use completely separate executables (often in some lightweight form) and call them using a remote procedure call (RPC). This approach maximized operating system re-use: the code needed to support the library is the same code being used to provide application support and security for every other program. Additionally, such systems do not require the library to exist on the same machine, but can forward the requests over the network. A remote procedure call (RPC) is a protocol that allows a computer program running on one host to cause code to be executed on another host without the programmer needing to explicitly code for this. ...
The downside to such an approach is that every library call requires a considerable amount of overhead. RPC calls are generally very expensive, and often avoided where possible. Nevertheless this approach has become popular in a number of domain-specific areas, notable client-server systems and application servers such as Java EnterpriseBeans. An application server is a server computer in a computer network dedicated to running certain software applications. ...
Shared library In addition to being loaded statically or dynamically, libraries are also often classified according to how they are shared among programs. Dynamic libraries almost always offer some form of sharing, allowing the same library to be used by multiple programs at the same time. Static libraries, by definition, cannot be shared; they are linked into each program. The shared library term is slightly ambiguous, because it covers at least two different concepts. First, it is the sharing of code located on disk by unrelated programs. The second concept is the sharing of code in memory, when programs execute the same physical page of RAM, mapped into different address spaces. It would seem that the latter would be preferable, and indeed it has a number of advantages. For instance on the OpenStep system, applications were often only a few hundred kilobytes in size and loaded almost instantly; the vast majority of their code was located in libraries that had already been loaded for other purposes by the operating system. There is a cost, however; shared code must be specifically written to run in a multitasking environment, and this has effects on performance. OpenStep is an open object-oriented API specification for an object-oriented operating system that uses any modern operating system as its core, principly developed by NeXT. It is important to recognize that while OpenStep is an API specification, OPENSTEP (all capitalized) is a specific implementation of this OpenStep developed...
RAM sharing can be accomplished by using position independent code as in Unix, which leads to a complex but flexible architecture, or by using normal, ie. not position independent code as in Windows and OS/2. These systems make sure, by various tricks like pre-mapping the address space and reserving slots for each DLL, that code has a great probability of being shared. Windows DLLs are not shared libraries in the Unix sense. The rest of this article concentrates on aspects common to both variants. In computing, position independent code (PIC) is object code that can execute at different locations in memory. ...
UNIX is a portable, multi-tasking and multi-user computer operating system originally developed by a group of AT&T Bell Labs employees including Ken Thompson, Dennis Ritchie, and Douglas McIlroy. ...
Version 2. ...
In most modern operating systems, shared libraries can be of the same format as the "regular" executables. This allows two main advantages: first, it requires making only one loader for both of them, rather than two. The added complexity of the one loader is considered well worth the cost. Secondly, it allows the executables also to be used as DLLs, if they have a symbol table. Typical executable/DLL formats are ELF (Unix) and PE (Windows). In Windows, the concept was taken one step further, with even system resources such as fonts being bundled in the DLL file format. The same is true under OpenStep, where the universal "bundle" format is used for almost all system resources. In computing, an operating system (OS) is the system software responsible for the direct control and management of hardware and basic system operations. ...
The Executable and Linkable Format (ELF) is a common standard in computing for executables and object code. ...
The Portable Executable (PE) format is an executable file format used in 32-bit and 64-bit versions of Windows operating systems. ...
The term DLL is mostly used on Windows and OS/2 products. On Unix platforms, the term shared library is more commonly used. This is technically justified in view of the different semantics. More explanations are available in the position independent code article. Version 2. ...
In computing, position independent code (PIC) is object code that can execute at different locations in memory. ...
In some cases, an operating system can become overloaded with different versions of DLLs, which impedes its performance and stability. Such a scenario is known as DLL-hell. DLL hell is a colorful term given to any problem based on a difficulty in managing Dynamically Linked Libraries (DLLs) installed on a particular copy of an operating system. ...
Object Libraries Dynamic linking developed during the late 1980s and was generally available in some form in most operating systems by the early 1990s. It was during the same period that object-oriented programming (OOP) was first making its way into the programming market. OOP requires additional information that traditional libraries don't supply; in addition to the names and entry points of the code located within, they also require a list of the objects they depend on. This is a side-effect of one of OOP's main advantages, inheritance, which means that the complete definition of any method may be defined in a number of places. This is more than simply listing that one library requires the services of another, in a true OOPs system, the libraries themselves may not be known at compile time, and vary from system to system. Events and trends The 1980s marked an abrupt shift towards more conservative lifestyles after the momentous cultural revolutions which took place in the 1960s and 1970s and the definition of the AIDS virus in 1981. ...
Events and trends Technology The World Wide Web was born at CERN Explosive growth of the Internet; decrease in the cost of computers and other technology Reduction in size and cost of mobile phones leads to a massive surge in their popularity Year 2000 problem (commonly known as Y2K) Microsoft...
In computer science, object-oriented programming, OOP for short, is a computer programming paradigm that emphasizes the following concepts: Objects - Packaging data and functionality together into units within a running computer program; objects are the basis of modularity and structure in an object-oriented computer program. ...
In computer science, compile time, as opposed to runtime, is the time when a compiler compiles code written in a programming language into an executable form. ...
At the same time another common area for development was the idea of multi-tier programs, in which a "display" running on a desktop computer would use the services of a mainframe or minicomputer for data storage or processing. For instance, a program on a GUI-based computer would send messages to a minicomputer to return small samples of a huge dataset for display. Remote procedure calls already handled these tasks, but there was no standard RPC system. Mainframes (often colloquially referred to as big iron) are large and expensive computers used mainly by government institutions and large companies for legacy applications, typically bulk data processing (such as censuses, industry/consumer statistics, ERP, and bank transaction processing). ...
HP2114 minicomputer Minicomputer is a largely obsolete term for a class of multi-user computers which make up the middle range of the computing spectrum, in between the largest multi-user systems (mainframe computers) and the smallest single-user systems (microcomputers or personal computers). ...
A remote procedure call (RPC) is a protocol that allows a computer program running on one host to cause code to be executed on another host without the programmer needing to explicitly code for this. ...
It was not long before the majority of the mini/mainframe vendors were working on projects to combine the two, producing an OOPs library format that could be used anywhere. Such systems were known as object libraries, or distributed objects if they supported remote access (not all did). Microsoft's COM is an example of such a system for local use, DCOM a modified version that support remote access. For some time object libraries were the "next big thing" in the programming world. There were a number of efforts to create systems that would run across platforms, and companies competed to try to get developers locked into their own system. Examples include IBM's System Object Model (SOM/DSOM), Sun Microsystems' Distributed Objects Everywhere (DOE), NeXT's Portable Distributed Objects (PDO), Digital's ObjectBroker, Microsoft's Component Object Model (COM/DCOM), and any number of CORBA-based systems. International Business Machines Corporation (IBM, or colloquially, Big Blue) (NYSE: IBM) (incorporated June 15, 1911, in operation since 1888) is headquartered in Armonk, New York, USA. The company manufactures and sells computer hardware, software, and services. ...
The System Object Model is an object-oriented shared library system developed by IBM. A distributed version based on CORBA, DSOM allowed objects on different computers to communicate. ...
Sun Microsystems is a computer, semiconductor and software manufacturer headquartered in Santa Clara, California, in Silicon Valley. ...
Distributed Objects Everywhere (DOE) was a long-running Sun Microsystems project to build a distributed computing environment based on the CORBA system in the back end and OpenStep as the user interface. ...
The NeXT logo, designed by Paul Rand. ...
Portable Distributed Objects, or PDO, is a programming API for creating object oriented code that runs anywhere on a network of computers. ...
A digital system is one that uses discrete values rather than a continuous spectrum of values: compare analog. ...
ObjectBroker <programming> A distributed object system from DEC based on the CORBA standard. ...
In programming, the Component Object Model (COM), also known as ActiveX, is a Microsoft technology for software componentry. ...
In computing, Common Object Request Broker Architecture (CORBA), is a standard for software componentry. ...
In the end, it turned out that OOP libraries were not the next big thing. With the exception of Microsoft's COM and NeXT's (now Apple Computer) DO, all of these efforts have since ended. Apple Computer, Inc. ...
Naming - GNU/Linux, Solaris and BSD variants:
libfoo.a and libfoo.so files are placed in folders like /lib, /usr/lib or /usr/local/lib are dynamically linked libraries. The filenames always start with lib, and end with .a (archive, static library) or .so (shared object, dynamically linked library), with an optional interface number. For example libfoo.so.2 is the second major interface revision of the dynamically linked library libfoo. Old Unix versions would use major and minor library revision numbers (libfoo.so.1.2) while contemporary Unixes will only use major revision numbers (libfoo.so.1). Dynamically loaded libraries are placed in /usr/libexec and similar directories. - Mac OS X and upwards: The system inherits static library conventions from BSD, and can use
.so-style libraries (with the .dylib suffix instead). Most libraries, however, are dynamic, and placed inside of special directories called "bundles," which wrap the library's required files and metadata. For example a library called "My Neat Library" would be implemented in a bundle called "My Neat Library.framework". - Microsoft Windows:
*.LIB files are statically linkable libraries and *.DLL files are dynamically linkable libraries. The interface revisions are encoded in the files, or abstracted away using COM-object interfaces. The GNU logo, drawn by Etienne Suvasa GNU is a recursive acronym for GNUs Not Unix. The GNU project was launched in 1983 by Richard Stallman with the goal of creating a complete operating system -- called the GNU system or simply GNU -- that is free software, meaning that users...
Tux, a penguin, is the official Linux mascot. ...
The Solaris Operating Environment is a computer operating system, based on the proprietary UNIX variant SunOS developed by Sun Microsystems. ...
BSD redirects here; for other uses see BSD (disambiguation). ...
UNIX is a portable, multi-tasking and multi-user computer operating system originally developed by a group of AT&T Bell Labs employees including Ken Thompson, Dennis Ritchie, and Douglas McIlroy. ...
Mac OS X is the latest version of the Mac OS, the operating system software for Macintosh computers. ...
BSD redirects here; for other uses see BSD (disambiguation). ...
Microsoft Windows is a range of closed source proprietary commercial operating environments for personal computers and servers. ...
In programming, the Component Object Model (COM), also known as ActiveX, is a Microsoft technology for software componentry. ...
See also GNU Libtool is a GNU programming tool from the GNU build system used for creating portable software libraries. ...
Software engineering (SE) is the profession concerned with creating and maintaining software applications by applying technologies and practices from computer science, project management, engineering, application domains, and other fields. ...
This list complements the software engineering article, giving more details and examples. ...
External links - Contains DLL files (http://www.dll-download.net)
- Program Library HOWTO (http://www.dwheeler.com/program-library/) for GNU/Linux
- Dynamic Linking and Loading (http://www.iecc.com/linker/linker10.html)
- Article "Faster C++ program startups by improving runtime linking efficiency (http://objprelink.sourceforge.net/objprelink.html)" by Léon Bottou and John Ryland
- LIB BFD (http://www.csa.iisc.ernet.in/resources/documentation/hypertext/bfd/bfd_toc.html) - the Binary File Descriptor Library
- PE Explorer (http://pexplorer.nm.ru/)
|