Jump to content

Code segment

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dsimic (talk | contribs) at 05:42, 2 May 2014 (See also: Added {{Portal|Computer programming}}; Alphabetized). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In computing, a code segment, also known as a text segment or simply as text, is one of the sections of a program in an object file or in memory, which contains executable instructions.[1]

It has a fixed size and is usually read-only. If the text section is not read-only, then the particular architecture allows self-modifying code. Fixed-position or position independent code may be shared in memory by several processes in segmented or paged memory systems.[1][2]

As a memory region, a code segment may be placed below the heap or stack in order to prevent heap and stack overflows from overwriting it.[3]

See also

References

  1. ^ a b Jason W. Bacon (2012-03-13). "Chapter 10. Subprogram Calls and the Stack". 10.4. Memory Segments. cs.uwm.edu. Retrieved 2014-05-02.
  2. ^ Kai Wang (2012-09-20). "Code Segment and Data Segment: Memory Layout of a Program". beingdeveloper.com. Retrieved 2014-05-02.
  3. ^ Yu-An Tan; Ji-yan Zheng; Yuan-Da Cao; Xue-lan Zhang (October 2005). "Buffer overflow protection based on adjusting code segment limit". ieeexplore.ieee.org. Retrieved 2014-05-02.