Talk:Code segment
This is the talk page for discussing improvements to the Code segment article. This is not a forum for general discussion of the article's subject. |
Article policies
|
Find sources: Google (books · news · scholar · free images · WP refs) · FENS · JSTOR · TWL |
![]() | Computing Stub‑class | |||||||||
|
Unnamed section
"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."
Not too sure about the 'below' part. The stack is commonly implemented as 'upside-down' (pushing onto the stack reduces stack pointer register) so it would make more sense to have it in memory that is 'higher' than the stack. — Preceding unsigned comment added by 176.249.187.76 (talk) 13:35, 16 January 2014 (UTC)
The technique would be ineffective for the heap when memory addresses are decremented. Sam Tomato (talk) 21:59, 12 October 2016 (UTC)
terminology
Why is the code segment also called the text segment? 118.208.38.118 (talk) 09:33, 12 March 2014 (UTC)
This article is very confusing. It mixes object files with processor memory and does not make it clear which is which.
To answer the question about code segments and text segments, a code segment is a type of text segment. In object files, the term "text segment" is very misleading; don't try to understand what text segments are based on that name. It would be more accurate to think of a text segment as a general-purpose type of data, of which executable code is one type. For the purpose of link-editing (the program that creates object files) executable code is just data that it does nothing to except copy from input to output. The linker might update addresses within the executable code but that is more commonly done by the operating system during execution. Sam Tomato (talk) 22:08, 12 October 2016 (UTC)