encyclopegia.org

Relocation (computing)

In software development, relocation is the process of assigning load addresses for position-dependent code and data of a program and adjusting the code and data to reflect the assigned addresses. A linker usually performs relocation in conjunction with symbol resolution, the process of searching files and libraries to replace symbolic references or names of libraries with actual usable addresses in memory before running a program. Relocation is typically done by the linker at link time, but it can also be done at load time by a relocating loader, or at run time by the running program itself.

In software development, relocation is the process of assigning load addresses for position-dependent code and data of a program and adjusting the code and data to reflect the assigned addresses. A linker usually performs relocation in conjunction with symbol resolution, the process of searching files and libraries to replace symbolic references or names of libraries with actual usable addresses in memory before running a program. Relocation is typically done by the linker at link time, but it can also be done at load time by a relocating loader, or at run time by the running program itself. ==Example== The following example uses Donald Knuth's MIX architecture and MIXAL assembly language. The principles are the same for any architecture, though the details will change. (A) Program SUBR is compiled to produce object file (B), shown as both machine code and assembly. The compiler may designate the start of the compiled code at an arbitrary location, often location 1, as shown. Location 13 contains the machine code for the jump instruction to statement ST in location 5. (C) If SUBR is later linked with other code, it may be stored at a location other than 1. In this example, the linker places it at location 120. The address in the jump instruction, which is now at location 133, must be relocated to point to the new location of the code for statement ST, now 125. [1 61 shown in the instruction is the MIX machine code representation of 125]. (D) When the program is loaded into memory to run, it may be loaded at some location other than the one assigned by the linker. This example shows SUBR now at location 300. The address in the jump instruction, now at 313, needs to be relocated again so that it points to the updated location of ST, 305. [4 49 is the MIX machine representation of 305]. ==Alternatives== Some architectures avoid relocation entirely by deferring address assignment to run time, as, for example, in stack machines with zero address arithmetic or in some segmented architectures where every compilation unit is loaded into a separate segment. (33 pages) (2+xiv+270+6 pages) [https://archive.org/stream/80-microcomputing-magazine-1983-04/80Microcomputing_0483_djvu.txt* [https://archive.org/stream/80-microcomputing-magazine-1985-04/80Microcomputing_0485_djvu.txt[https://archive.org/download/80-microcomputing-magazine-1985-04/80Microcomputing_0485_text.pdf]

References

No reference rows published for this article.

Cite this article

MLA

"Relocation (computing)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/relocation-computing. Accessed 24 November 2026.

Chicago

"Relocation (computing)." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/relocation-computing.

APA

encyclopegia.org. (2026). Relocation (computing). Retrieved November 24, 2026, from https://encyclopegia.org/wiki/relocation-computing

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

S-400 missile system

enwiki · references available

Columbia River High School

enwiki · references available

Ashbury, New South Wales

enwiki · references available

Roman Krzyżelewski

enwiki · references available

Speakers Bank

enwiki · references available

GIC (sovereign wealth fund)

enwiki · references available

Franklin Township, Portage County, Ohio

enwiki · references available

Red Deer River

enwiki · references available

A9home

enwiki · references available

Calumet Farm

enwiki · references available

GoBack

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1370522509 · 0.5 · snapshot enwiki-001370522509

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.