Self-relocation

In computer programming, a self-relocating program is a program that relocates its own address-dependent instructions and data when run, and is therefore capable of being loaded into memory at any address.[1] Self-relocating code is a form of self modifying code.

Discussion

Self-relocation is similar to the relocation process employed by the linker-loader when a program is copied from external storage into main memory; the difference is that it is the loaded program rather than the loader that performs the relocation.

As an extreme example of self-relocation it is possible to construct a computer program so that it does not stay at a fixed address in memory, even as it executes. The Apple Worm[2] is a dynamic self-relocator.

References

  1. Dhamdhere, D M (1999), Systems Programming and Operating Systems, New Delhi: Tata McGraw-Hill Education, p. 232, retrieved 8 Nov 2011
  2. Dewdney, AK (March 1985). "Computer Recreations". Scientific American 285: 38–39.

See also