/OPTFUNC, /NOOPTFUNC Linker Option

Syntax: Default:
/OPTF[UNC] /NOOPTF
/NOOPTF[UNC]  

Use /OPTFUNC to remove unreachable functions. The linker removes functions that are:

When the function is removed, any additional functions that were required only by that function are also removed. Removing the functions and code reduces the size of your output file.

By default, the linker does not remove unreachable functions.

Note: The object code you are linking must be compiled with the /Gl option for /OPTFUNC to take effect.

If you are compiling and linking in one step, you do not need to specify /OPTFUNC: the compiler passes /OPTFUNC to the linker automatically when you specify /Gl.

Performance Consideration: Optimized linking generally takes longer than regular linking. However, if the optimization is effective enough, it can actually speed up the linking process, because there is less information to write to file. Generally, you may want to link without the /OPTFUNC option until your code is tested and stable.



Summary of Linker Options
Optimized Linking