Relocation (computing): Difference between revisions

Content deleted Content added
fixed citation bot
top: CE. I think Nbarth (2014-11-16T02:47:32‎) was referring to zero address arithmetics in stack machines rather than to zero-//based// addressing
Line 4:
{{Use list-defined references|date=December 2021}}
{{Use American English|date=January 2019}}
{{anchor|Static|Dynamic|Compile-time|Load-time|Run-Time|Virtual|Page boundary|Paragraph boundary|Segment|Offset|Line}}
'''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.<ref name="Intel_iRMX"/><ref name="Levine_1999_CH1_CH3"/> Prior to the advent of multiprocess systems, and still in many embedded systems, the addresses for objects were [[absolute address|absolute]] starting at a known ___location, often zero. Since multiprocessing systems dynamically link and switch between programs it became necessary to be able to relocate objects using [[position-independent code]].
A [[Linkerlinker (computing)|linker]] usually performs relocation in conjunction with '''symbol resolution''', the process of searching files and libraries to replace symbolic references or names of [[Librarylibrary (computer science)|libraries]] with actual usable addresses in [[primary storage|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 (computing)|loader]], or at [[Runrun time (program lifecycle phase)|run time]] by the running program [[self-relocation|itself]]. Some architectures avoid relocation entirely by deferring address assignment to run time; as, for example, in stack machines with [[zero address arithmetic]] and in some segmented architectures where every compilation unit is loaded into a separate segment.
 
== Segmentation ==