Citizendia
Your Ad Here

Figure of the linking process, where object files and static libraries are assembled into a new library or executable.
Figure of the linking process, where object files and static libraries are assembled into a new library or executable.

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. Computer science (or computing science) is the study and the Science of the theoretical foundations of Information and Computation and their Computer programs (also software programs, or just programs) are instructions for a Computer. In Computer science, object code, or an object file, is the representation of code that a Compiler or Assembler generates by processing A compiler is a Computer program (or set of programs that translates text written in a computer language (the source language) into another In Computing, an executable (file causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a file that only contains

In IBM mainframe environments such as OS/360 this program is known as a linkage editor. International Business Machines Corporation abbreviated IBM and nicknamed "Big Blue", is a multinational Computer Technology Mainframes (often colloquially referred to as Big Iron) are Computers used mainly by large organizations for critical applications typically bulk data See also History of IBM mainframe operating systems OS/360, officially known as IBM System/360 Operating System, was a group of Batch processing

(On Unix variants the term loader is often used as a synonym for linker. Unix (officially trademarked as UNIX, sometimes also written as Unix with Small caps) is a computer In Computing, a loader is the part of an operating system that is responsible for loading programs from executables (i 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. In Computer science, compile time refers to either the operations performed by a Compiler (the "compile-time operations" or Programming language In Computer science, runtime or run time describes the operation of a Computer program, the duration of its execution from beginning to termination However, in some operating systems the same program handles both the jobs of linking and loading a program; see dynamic linking. In Computer science, a library is a collection of Subroutines used to develop Software. )

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). In Computer science, object code, or an object file, is the representation of code that a Compiler or Assembler generates by processing In Computer science, a reference is an object containing information which refers to data stored elsewhere as opposed to containing the data itself The musical instrument is spelled Cymbal. A symbol is something --- such as an object, Picture, written word a sound a piece Typically, an object file can contain three kinds of symbols:

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. In Computer science, object code, or an object file, is the representation of code that a Compiler or Assembler generates by processing

Linkers can take objects from a collection called a library. In Computer science, a library is a collection of Subroutines used to develop Software. 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. In Computing, an address space defines a range of discrete addresses each of which may correspond to a physical or virtual Memory register, a network host This may involve relocating code that assumes a specific base address to another base. In Computing, a base address is an Address serving as a reference point ("base" for other addresses 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. Typical PC hardware A typical Personal computer consists of a case or chassis in a tower shape (desktop and the following parts Motherboard Virtual memory is a Computer system technique which gives an application program the impression that it has contiguous working memory while in fact it may be physically This pass may also be omitted if the executable is a position independent executable. In Computing, position-independent code ( PIC) or position-independent executable ( PIE) is machine instruction code that executes properly

Contents

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. In Computing, a dynamic linker is the part of an Operating system (OS that loads and links the Shared libraries for an executable when it is run An operating system (commonly abbreviated OS and O/S) is the software component of a Computer system that is responsible for the management and coordination In Computer science, a library is a collection of Subroutines used to develop Software. 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:

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.

See also

References

External links

Dictionary

linker

-noun

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

-verb

  1. (genetics) To ligate a DNA segment using a linker.
© 2009 citizendia.org; parts available under the terms of GNU Free Documentation License, from http://en.wikipedia.org
Dapyx Software network: MP3 Explorer | Ebook Manager | Zenithic