Is "memory segment" an intel-only concept in assembly programming?

82 views Asked by At

Sees linux memory management is page-based only, not having the concept of "segment".

But still, the at&t assembly has the concept of "section", like code section, data section, just like intel assmebly's "segment", and they look very similar.

So my question is, is "section" having the same meaning like "segment" in intel assembly?

1

There are 1 answers

2
user3344003 On BEST ANSWER

Linkers collect pages with the same attributes into "sections" or "program sections" or "psects." Usually is the default is to create one section for each memory attribute. Typically:

  1. Readonly
  2. Read/write
  3. Demand Zero
  4. Executable

However, most linkers have advanced settings that allow the programmer to set up the psects differently.

Some assemblers have psect directives to place data in a particular section.

Sometimes psects are called "segments." E.g., the "code segment"

There are also hardware segments that, as you suggest, are pretty much a brain damaged aspect of many Intel processors (although some other processors use[d] them). In 64-bit mode, Intel has finally dumped segments. A segment in this uses is accessed by segment registers.

Thus, these are two different concepts.