AskDefine | Define linker

User Contributed Dictionary

English

Etymology

-er link

Pronunciation

Noun

  1. a computer program that takes one or more objects generated by compilers and assembles them into a single executable program.
  2. A short oligonucleotide containing a recognition sequence for a restriction enzyme, used to blunt the ends of sticky DNA segments.

Synonyms

Derived terms

Translations

computer program that assembles objects
short oligonucleotide

Verb

  1. To ligate a DNA segment using a linker.
    • 1994, Ray Shillito et al., "Zea mays plants regenerated from protoplasts or protoplast-derived cells", US Patent 5770450, page 52:
      38. The plasmid pRK252 Km is cut with ecoRI, blunt-ended using Klenow, and linkered with BgIII linkers (New England Biolabs).

Extensive Definition

In computer science, a linker or link editor is a program that takes one or more objects generated by compilers and assembles them into a single executable program.
In IBM mainframe environments such as OS/360 this program is known as a linkage editor.
(On Unix variants the term loader is often used as a synonym for linker. Because this usage blurs the distinction between the compile-time process and the run-time process, this article will use linking for the former and loading for the latter. However, in some operating systems the same program handles both the jobs of linking and loading a program; see dynamic linking.)
Computer programs typically comprise several parts or modules; these parts, if not all contained within a single object-code file, refer to each other by means of symbols (Grover 2002). Typically, an object file can contain three kinds of symbols:
  • defined symbols, which allow it to be called by other modules,
  • undefined symbols, which call the other modules where these symbols are defined, and
  • local symbols, used internally within the object file to facilitate relocation (Grover 2002).
When a program comprises multiple object-code files, the linker combines these files into a unified executable program, resolving the symbols as it goes along.
Linkers can take objects from a collection called a library. Some linkers do not include the whole library in the output; they only include its symbols that are referenced from other object files or libraries. Libraries exist for diverse purposes, and one or more system libraries are usually linked in by default.
The linker also takes care of arranging the objects in a program's address space. This may involve relocating code that assumes a specific base address to another base. Since a compiler seldom knows where an object will reside, it often assumes a fixed base location (for example, zero). Relocating machine code may involve re-targeting of absolute jumps, loads and stores.
The executable output by the linker may need another relocation pass when it is finally loaded into memory (just before execution). This pass is usually omitted on hardware offering virtual memory — every program is put into its own address space, so there is no conflict even if all programs load at the same base address. This pass may also be omitted if the executable is a position independent executable.

Dynamic linking

see also Dynamic linker Modern operating system environments allow dynamic linking, that is 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.
This approach 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 an error in a library function is corrected by replacing the library, all programs using it dynamically will benefit from the correction after restarting them. Programs that included this function by static linking would have to be re-linked first.

Relaxation

As the compiler has no information on the layout of objects in the final output, it cannot take advantage of shorter or more efficient instructions that place a requirement on the address of another object. For example, a jump instruction can reference an absolute address or an offset from the current location, and the offset could be expressed with different lengths depending on the distance to the target. By generating the most conservative instruction (usually the largest relative or absolute variant, depending on platform) and adding relaxation hints, it is possible to substitute shorter or more efficient instructions during the final link. This step can be performed only after all input objects have been read and assigned temporary addresses; the relaxation pass subsequently re-assigns addresses, which may in turn allow more relaxations to occur. In general, the substituted sequences are shorter, which allows this process to always converge on the most optimal solution given a fixed order of objects; if this is not the case, relaxations can conflict, and the linker needs to weigh the advantages of either option.

References

linker in Bosnian: Linker
linker in Czech: Linker
linker in Danish: Linker
linker in German: Binder (Computerprogramm)
linker in Estonian: Linkija
linker in Spanish: Enlazador
linker in Persian: پیوندده
linker in French: Édition de liens
linker in Italian: Linking
linker in Hebrew: מקשר (תוכנה)
linker in Dutch: Linken
linker in Japanese: リンケージエディタ
linker in Polish: Konsolidator
linker in Portuguese: Ligador
linker in Russian: Компоновщик
linker in Thai: โปรแกรมเชื่อมโยง
linker in Turkish: Bağlayıcı
linker in Chinese: 链接器
Privacy Policy, About Us, Terms and Conditions, Contact Us
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2
Material from Wikipedia, Wiktionary, Dict
Valid HTML 4.01 Strict, Valid CSS Level 2.1