C/C++ Compiler (cl.hlp) (Table of Contents; Topic list)
Controlling Linker Access to Individual Functions (/Gy)
                                             Up Contents Index Back
─────C/C++ Compiler─────────────────────────────────────────────────────────
 
     Syntax:  /Gy
 
     The /Gy option enables linking on a function-by-function basis by
     creating packaged functions. A packaged function is visible to the
     linker in the form of a COMDAT record. Packaged functions have
     several uses:
 
        ■ LINK automatically excludes unreferenced packaged functions
          from the executable file. (You can prevent this behavior by
          specifying the /NOPACKF option.)
          See: LINK /NOPACKF Option
 
        ■ You can place packaged functions in a specified order in the
          executable file by using a FUNCTIONS statement in a
          module-definition (.DEF) file.
          See: FUNCTIONS
 
        ■ You can assign individual packaged functions to a specified
          segment by using a FUNCTIONS statement.
          See: FUNCTIONS
 
        ■ You can place individual packaged functions in a specified
          overlay in a DOS program by using a FUNCTIONS statement.
          See: Creating Overlaid DOS Programs
 
     For C++, member functions are automatically packaged; other
     functions are not, and /Gy is required to compile them as packaged
     functions.
                                    -♦-