LINK Help (linker.hlp) (Table of Contents; Topic list)
Packaged Functions
                                             Up Contents Index Back
─────LINK───────────────────────────────────────────────────────────────────
 
     A packaged function is visible to the linker in the form of a
     COMDAT record in the object file.
 
     To compile a C function as a packaged function:
 
        ■ On the CL command line, use the /Gy option.
          See: CL /Gy Option
 
        ■ In PWB, choose Enable Function Level Linking in the
          Additional Global Options dialog box, which is available from
          the C or C++ Compiler Options dialog boxes.
 
     In a C++ program, member functions are automatically packaged.
 
     Packaged functions have the following uses:
 
        ■ If a packaged function is defined but not called, LINK
          automatically removes the definition from the executable
          file. You can use /NOPACKF to preserve the definition.
          See: /NOPACKF Option
 
        ■ Packaged functions can be placed in a specified order in the
          executable file by using a FUNCTIONS statement.
          See: FUNCTIONS Statement
 
        ■ Individual packaged functions can be assigned to a specifed
          segment by using FUNCTIONS.
 
        ■ A packaged function can be placed into an overlay by using
          the FUNCTIONS statement.
          See: Creating Overlaid DOS Programs
 
     A packaged function in a C++ module sometimes must be referred to
     by its decorated name.
     See: Decorated Names
                                    -♦-