PRB: Data Section Names Limited to Eight Characters

Last reviewed: March 17, 1998
Article ID: Q100292

The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) included with:

    - Windows NT versions 3.1, 3.5, 3.51, 4.0

SYMPTOMS

You can use #pragma data_seg to name data sections. This method is commonly used so that the named data sections can be shared using the SECTIONS statement in the DEF file or with a linker switch (/SECTION:name,RWS). However, if the length of the name specified in the pragma exceeds eight characters, then the section might not be properly shared.

CAUSE

The linker does not support sections with longer names. The longer names require use of the COFF strings table, so the rewrite is not trivial.

MORE INFORMATION

Note that the first character of a section name may be a period so that it is consistent with compiler and linker defaults. (The period is not required.) If used, the section name (as specified in both the pragma and the DEF file) can be a maximum of a period followed by seven characters.

For more information on the shared named-data section, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q89817
   TITLE     : How to Specify Shared and Nonshared Data in a DLL
Keywords          : TlsMisc
Version           : WINNT:3.1,3.5,3.51,4.0;
Platform          : winnt
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.

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