Producing One _TEXT Segment for Multiple Object Modules

Last reviewed: July 17, 1997
Article ID: Q43128
6.00 6.00a 6.00ax 7.00 | 6.00 6.00a | 1.00 1.50
MS-DOS                 | OS/2       | WINDOWS
kbtool

The information in this article applies to:

   The Microsoft C/C++ Compiler (CL.EXE) included with:
    - Microsoft C for MS-DOS, versions 6.0, 6.0a, and 6.0ax
    - Microsoft C for OS/2, versions 6.0 and 6.0a
    - Microsoft C/C++ for MS-DOS, version 7.0
    - Microsoft Visual C++ for Windows, versions 1.0 and 1.5

SUMMARY

When Microsoft C compiles an applicaiton in the medium or large memory model, it produces multiple code segments. Each logical code segment has a name of the following form <modulename>_TEXT. In an application built with the small or compact memory model, the compiler generates only one logical code segment, named _TEXT.

MORE INFORMATION

A map file lists the names of each segment and the information each segment contains. To generate a map file, specify the /Fm compiler option switch or the /M linker option switch.

The following excerpt from a map file shows the segments generated linking an application with two object modules that were compiled in the small memory model:

   Start  Stop   Length Name                   Class
   00000H 016EAH 016EBH _TEXT                  CODE

The following excerpt from a map file shows the segments generated linking an application with two object modules that were compiled in the large memory model:

   Start  Stop   Length Name                   Class
   00000H 0000DH 0000EH MAPL_TEXT              CODE
   0000EH 00023H 00016H MAP2_TEXT              CODE
   00024H 01B2CH 01B09H _TEXT                  CODE

MAPL_TEXT and MAP2_TEXT contain the code contained in the MAPL.OBJ and MAP2.OBJ files, respectively. The _TEXT segment contains code from the Microsoft run-time library and any other libraries.


Additional reference words: kbinf 1.00 1.50 6.00 6.00a 6.00ax 7.00 7.00a
8.00 8.00c
KBCategory: kbtool
KBSubcategory: CLIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.