KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q123874: PRB: Section Names Truncated to Eight Characters When Linked

Article: Q123874
Product(s): Microsoft C Compiler
Version(s): 2.0
Operating System(s): 
Keyword(s): 
Last Modified: 11-FEB-2002

-------------------------------------------------------------------------------
The information in this article applies to:

- The Linker (LINK.EXE), included with:
   - Microsoft Visual C++, 32-bit Editions, version 2.0 
   - Microsoft Visual C++, Macintosh Cross-Development Addon, version 2.0 
-------------------------------------------------------------------------------

SYMPTOMS
========

You can control the section names that the C/C++ compiler, version 9.0,
generates by using the /ND or /NT compiler options, the code_seg pragma, or the
data_seg pragma. However, the names generated by the compiler are truncated to
eight-character names during linking with LINK version 2.5.

STATUS
======

This behavior is by design. Section names are limited to eight characters.

MORE INFORMATION
================

Steps to Reproduce Behavior
---------------------------

1. Build the following sample code

  test.c
     ------

     #pragma code_seg( "LongCodeSectionName" )
     int i=7;

     main( )
     {
        exit(i);
     }

2. Observe the long section name contained in the object file by executing this
  command:

  link -dump -all test.obj > testobj.out

  Then search the output file for LongCodeSectionName. The full name is in the
  object file.

3. Observe that LongCodeSectionName is truncated to LongCode in the executable
  file by executing this command:

  link -dump - all test.exe > testexe.out

Additional query words: 2.50 9.00

======================================================================
Keywords          :  
Technology        : kbVCsearch kbAudDeveloper kbLINKSearch kbLINK100
Version           : :2.0
Issue type        : kbprb

=============================================================================

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.

Copyright Microsoft Corporation 1986-2002.