LINK Help (linkx.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
/DOSSEG Option
                                             Up Contents Index Back
─────/DOSSEG Option─────────────────────────────────────────────────────────
 
     Syntax:  /DO[SSEG]
 
     The /DOSSEG option forces segments to be ordered as follows:
 
       1. All segments with a class name ending in CODE
 
       2. Far data segments (segments outside DGROUP)
 
       3. Near data (DGROUP) segments, in the following order:
 
            a. Segments of class BEGDATA (reserved for Microsoft use)
            b. Any segments not of class BEGDATA, BSS, or STACK
            c. Segments of class BSS
            d. Segments of class STACK
 
     In addition, /DOSSEG causes LINK to
 
        ■ Initialize two special variables:
 
               _edata = DGROUP : BSS
               _end   = DGROUP : STACK
 
          The variables _edata and _end have special meanings for
          Microsoft compilers; avoid using these names in your
          programs. Assembly-language programs can reference these
          variables but should not change them.
 
        ■ Insert 16 null bytes at the beginning of the _TEXT segment
          (if this segment is defined). This null area provides
          protection in case a null pointer is used. To suppress the
          null bytes, use the /NONULLS option instead of /DOSSEG;
          /NONULLS overrides the DOSSEG comment record found in
          standard Microsoft libraries.
          See: /NONULLS Option
 
     The /DOSSEG option is mainly for use with assembly-language
     programs. A special object-module record in the Microsoft language
     libraries automatically enables /DOSSEG. /DOSSEG is also enabled
     by assembly programs that use the Microsoft Macro Assembler (MASM)
     directive .DOSSEG.
                                    -♦-