Static build

Static build

A static build is a compiled version of a program which has been statically linked against libraries.

In computer science, linking means taking one or more objects generated by compilers and assemble them into a single executable program. The objects are program modules containing machine code and "symbol" definitions, which come in two varieties:
*"Defined" or "exported" symbols are functions or variables that are present in the module represented by the object, and which should be available for use by other modules.
*"Undefined" or "imported" symbols are functions or variables that are called or referenced by this object, but not internally defined.

A linker program then resolves references to undefined symbols by finding out which other object defines a symbol in question, and replacing placeholders with the symbol's address. Linkers can take objects from a collection called a "library". The final program does not include the whole library, only those objects from it that are needed. Libraries for diverse purposes exist, and one or more system libraries are usually linked in by default.

Modern operating system environments allow "dynamic linking", or the postponing of the resolving of some undefined symbols until a program is run. That means that the executable still contains undefined symbols, plus a list of objects or libraries that will provide definitions for these. Loading the program will load these objects/libraries as well, and perform a final linking.

In a statically built program, no dynamic linking occurs: all the bindings have been done at compile time.

Dynamic linking offers two advantages:
*Often-used libraries (for example the standard system libraries) need to be stored in only one location, not duplicated in every single binary.
*If a library is upgraded or replaced, all programs using it dynamically will immediately benefit from the corrections. Static builds would have to be re-linked first.

On the other hand, static builds have a very predictable behavior (because they do not rely on the particular version of libraries which is available on the final system), and are commonly found in forensic and security tools to avoid possible contamination or malfunction due to broken libraries on the examined machine. The same flexibility that permits an upgraded library to benefit all dynamically-linked applications can also prevent applications that assume the presence of a specific version of a particular library from running correctly. If every application on a system must have its own copy of a dynamic library to ensure correct operation, the benefits of dynamic linking are moot.

Another benefit of static builds is their portability: once the final executable file has been compiled, it is no longer necessary to keep the library files that the program references, since all the relevant parts are copied into the executable file. As a result, when installing a statically-built program on a computer, the user doesn't have to download and install additional libraries: the program is ready to run.

ee also

*Library
*Name decoration
*Relocation table

References

*cite book|last=Levine|first=John R.|authorlink=John R. Levine|title=Linkers and Loaders|year=2000|publisher=Morgan Kaufmann|location=San Francisco|id=ISBN 1-55860-496-0
*cite web |url=http://users.actcom.co.il/~choo/lupg/tutorials/libraries/unix-c-libraries.html |title=Building And Using Static And Shared "C" Libraries |accessdate=2007-11-17 |author=Keren, Guy |date=2002 |publisher=Little Unix Programmers Group


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Static library — In computer science, a static library or statically linked library is a set of routines, external functions and variables which are resolved in a caller at compile time and copied into a target application by a compiler, linker, or binder,… …   Wikipedia

  • Static grass — is used in model railroading and miniature wargaming to create realistic looking grass textures. It consists of small threadlike particles charged with static electricity, making it stand up when glued to a surface. Several companies produce… …   Wikipedia

  • Static electricity — For the science of static charges see Electrostatics Static electricity refers to the accumulation of excess electric charge in a region with poor electrical conductivity (an insulator), such that the charge accumulation persists. The effects of… …   Wikipedia

  • Static program analysis — This article is about certain software quality assessment methods. For the statistical method, see Static analysis. Static program analysis (also Static code analysis or SCA) is the analysis of computer software that is performed without actually …   Wikipedia

  • static electricity — /ˌstætɪk ɛlɛkˈtrɪsəti/ (say .statik elek trisuhtee) noun 1. electricity at rest, as that produced by friction: *a few tonnes of feed were destroyed in the blaze, which was thought to have been caused by a build up of static electricity. –aap news …  

  • List of tools for static code analysis — This is a list of significant tools for static code analysis.Historical products* Lint the original static code analyzer of C code.Open source or Noncommercial products .NET (C#, VB.NET and all .NET compatible languages) *… …   Wikipedia

  • Ebon (Static Shock) — Superherobox| caption=Ebon character name=Ebon real name= Ivan Evans species=Metahuman publisher=Milestone Media debut= Static Shock creators= alliance color=background:#c0c0ff alliances=Meta Breed aliases= powers=Transmorph; a living shadow like …   Wikipedia

  • List of Static Shock characters — This is a list of characters who appear in the series Static Shock. Contents 1 Static 2 Gear 3 Sharon Hawkins 4 The Meta Breed …   Wikipedia

  • GNU build system — GNU logo The GNU build system, also known as the Autotools, is a suite of programming tools designed to assist in making source code packages portable to many Unix like systems. It can be difficult to make a software program portable: the C… …   Wikipedia

  • Debian build toolchain — A typical input of the Debian build tools: three files constituting the source package (the bottom) and the unpacked source tree with a debian subdirectory added there by the package maintainer. The Debian build toolchain is a collection of… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”