Relocation (computing): Difference between revisions

Content deleted Content added
GreenC bot (talk | contribs)
Reformat 1 archive link. Wayback Medic 2.5 per WP:URLREQ#citeftp
review: WP:OVERLINK. MOS:SLASH. grammar.
Line 18:
The relocation table is a list of addresses created by a [[compiler]] or [[Assembler (computer programming)#Assembler|assembler]] and stored in the object or executable file. Each entry in the table references an absolute address in the object code that must be changed when the loader relocates the program so that it will refer to the correct ___location. Entries in the relocation table are known as ''fixups'' and are designed to support relocation of the program as a complete unit. In some cases, each fixup in the table is itself relative to a base address of zero, so the fixups themselves must be changed as the loader moves through the table.<ref name="Levine_1999_CH1_CH3"/>
 
In some architectures, a fixup that crosses certain boundaries (such as a segment boundary) or that is not aligned on a word boundary is illegal and flagged as an error by the linker.<ref name="Borland_2007"/>
 
=== DOS and 16-bit Windows ===
Far [[pointer (computer programming)|pointer]]s ([[32-bit]] pointers with [[x86 memory segmentation|segment]]:offset, used to address 20-bit 640 &nbsp;[[kilobyte|KB]] [[computer storage|memory]] space available to [[DOS]] [[computer program|program]]sprograms), which point to code or data within a [[DOS executable]] ([[EXE]]), do not have absolute segments, because the actual [[memory address|address]] of code/ or data depends on where the program is loaded in memory and this is not known until the program is loaded.
 
Instead, segments are relative values in the DOS EXE file. These segments need to be corrected, when the executable has been loaded into memory. The EXE [[loader (computing)|loader]] uses a relocation table to find the segments whichthat need to be adjusted.<!--[[User:Kvng/RTH]]-->
 
=== 32-bit Windows ===