Unreferenced Packaged Functions Appear in Map File

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:

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

Last Reviewed: July 18, 1997