FIX: FUNCTION

Last reviewed: September 16, 1997
Article ID: Q87940
5.30 5.31 MS-DOS kbtool kbbuglist kbfixlist

The information in this article applies to:

  • Microsoft LINK for MS-DOS, versions 5.3 and 5.31

SYMPTOMS

An attempt to assign a packaged function to a segment fails and Microsoft LINK creates an empty segment in the executable file. An attempt to move the segment into an overlay successfully places the empty segment into the specified overlay, but the function remains in the resident (root) portion of the application.

RESOLUTION

Modify the module-definition (.DEF) file to use the following syntax to place a packaged function into an overlay:

   FUNCTIONS:1 _func1 _func2

To assign a function to another segment or to change the ordering of the functions in a segment, modify the source code to change the placement or order of the functions, as appropriate.

STATUS

Microsoft has confirmed this to be a problem in LINK versions 5.3 and 5.31.009 for MS-DOS. This problem was corrected in LINK version 5.5 for MS- DOS.

MORE INFORMATION

According to page 625 of the Microsoft C/C++ "Environment and Tools" manual for version 7.0, to assign a packaged function to a segment in a specified order use the FUNCTIONS statement in the .DEF file as follows:

   FUNCTIONS:<segmentname> <function> [<function>...]

(To create packaged functions, specify the /Gy option on the C/C++ compiler command line.) When LINK processes a FUNCTIONS statement of this type and the error above occurs, LINK creates an empty segment named <segmentname>. Because the functions reside in a COMDAT record in the object file, LINK creates a segment named comdat_seg1 in the executable file for the functions.

According to page 601 of the "Environment and Tools" manual, the following statements place specified functions into a segment and place the segment into an overlay:

   SEGMENTS <segmentname> OVL:<segmentnum>
   FUNCTIONS:<segmentname> <function> [<function>...]

When LINK processes the SEGMENTS and FUNCTIONS statements and the error above occurs, LINK creates an empty segment named <segmentname> and places it into the specified overlay. However, the functions remain in the resident portion of the application.


Additional reference words: 5.30 5.31.009
KBCategory: kbtool kbbuglist kbfixlist
KBSubcategory: MoveOverlay
Keywords : kb16bitonly
Solution Type : kbfix


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: September 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.