Unreferenced Packaged Functions Appear in Map File

Last reviewed: July 17, 1997
Article ID: Q85506
5.3x 5.50 5.60 5.60.220 5.60.339 MS-DOS kbtool kbcode

The information in this article applies to:

  • Microsoft LINK for MS-DOS, versions 5.3x, 5.5, 5.6, 5.6.22, and 5.6.339

SUMMARY

In Microsoft C/C++ version 7.0, the -Gy compiler option enables function-level linking by creating packaged functions. By default, Microsoft LINK uses the /PACKF[UNCTIONS] and does not include unreferenced packaged functions in the output file. However, these functions do appear in the map file.

This information was retained to provide information regarding which items were removed from the executable file.

MORE INFORMATION

The code example below illustrates this behavior. After building the source code and linking with LINK version 5.3, the map file contains the following information:

   Origin   Group
   0148:0   DGROUP

    Address         Publics by Name

   ...
   0000:0C54       _fflush
   0000:0000  Abs  _func              <== Constant (absolute) value
   0000:144E       _main
   ...

Linking the same source with LINK version 5.31.009 or later, the map file contains the following entry:

   Origin   Group
   0148:0   DGROUP

    Address         Publics by Name

   ...
   0000:0C54       _fflush
   0000:0000  Unr  _func              <== Unreferenced value
   0000:144E       _main
   ...

Sample Code

/*
 * Compile options needed: /Gy
 */

#include <stdio.h>

void func(void)
{
   printf("Hello from func.\n");
}

void main(void)
{
   printf("Hello from main.\n");
}


Additional reference words: kbinf 5.30 5.31.009 5.50 5.60 5.60.220 5.60.339
KBCategory: kbtool kbcode
KBSubcategory: LinkIss
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.