| Syntax: | Default: |
| /SEGO[RDER] /NOSEGO[RDER] |
Use /SEGORDER to change the default order in which the linker assigns sections to segments.
The linker keeps a list of sections that it encounters. Sections can be introduced to the linker by #pragma alloc_text, #pragma data_seg, or the /SECTION option. This list is maintained in the order the sections were encountered.
If /SEGORDER is in effect, the list is sorted as follows before assigning segments.
Within a segment, sections will maintain their initial order relative to one another.
The linker now traverses the section list assigning adjacent, compatible sections to the same segment. When a section with incompatible attributes is encountered, a new segment is started using the new attributes.
Section groups introduce one more complexity to this process: grouped sections will be adjacent and are assigned to the same segment regardless of attribute conflicts.