Microsoft KB Archive/31991

= How LINK Orders and Combines Segments =

Article ID: 31991

Article Last Modified on 10/23/2003

-

APPLIES TO


 * Microsoft LINK for MS-DOS 3.x
 * Microsoft LINK for MS-DOS 4.x
 * Microsoft LINK for MS-DOS 5.0x
 * Microsoft LINK for MS-DOS 5.1x
 * Microsoft LINK for MS-DOS 5.3
 * Microsoft LINK for MS-DOS 5.31.009
 * Microsoft LINK for MS-DOS 5.5
 * Microsoft LINK for MS-DOS 5.6
 * Microsoft LINK for OS/2 5.0x
 * Microsoft LINK for OS/2 5.3

-



This article was previously published under Q31991



Every application segment belongs to a named class such as &quot;CODE,&quot; &quot;DATA,&quot; or &quot;BSS.&quot; LINK orders segments in the output file to place segments that have the same class into the file contiguously. LINK does not change the order of segment classes and, within each class, LINK does not change the order of segments.

In an assembly language application, if a segment does not have a class name, the linker assigns it to the null class, which is processed as any other segment class.

If the linker command line includes the /DOSSEG option switch or specifies a run-time library from a Microsoft language product, LINK imposes the following order on the segments in the output file:   code     - class names that end in &quot;CODE&quot; far data - all segment classes except for &quot;DGROUP&quot; and code DGROUP  - (this segment is the default

data segment for the application)              - class &quot;BEGDATA&quot; (a special run-time segment)               - near initialized data (all data except for &quot;BSS&quot; and &quot;STACK&quot;)              - near BSS uninitialized data (class &quot;BSS&quot;)               - stack (class &quot;STACK&quot;)

Additional query words: kbinf 3.00 3.60 4.10 5.10 5.30 5.50 5.60

Keywords: kb16bitonly KB31991

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.