Microsoft KB Archive/87940

{|
 * width="100%"|

FIX: FUNCTION

 * }

Q87940

-

The information in this article applies to:


 * Microsoft LINK for MS-DOS

-

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++ &quot;Environment and Tools&quot; 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: [ ...]" (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. 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 &quot;Environment and Tools&quot; manual, the following statements place specified functions into a segment and place the segment into an overlay:

SEGMENTS OVL:

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

Additional query words: 5.30 5.31.009

Keywords : kb16bitonly

Issue type :

Technology : kbAudDeveloper kbZNotKeyword3 kbLINKSearch