The /OPT:REF
option causes the Visual C++ linker to
Exclude functions and/or data that are never referenced
(MSDN)
This seems like it would be a good way to identify obsolete code in a legacy codebase. Is there any way to get the linker to output what is eliminated?